Skip to content

Commit

Permalink
Merge pull request wardi#10 from vstoykov/master
Browse files Browse the repository at this point in the history
Fix wardi#7 Use `model._meta.model_name` if available else fallback to `module_name`
  • Loading branch information
smacker committed Dec 9, 2014
2 parents d68ffc7 + 4801905 commit a272cf1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion filebrowser/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ def has_delete_permission(self, request, obj=None):
return False

def get_urls(self):
info = self.model._meta.app_label, self.model._meta.module_name
opts = self.model._meta
info = opts.app_label, (opts.model_name if hasattr(opts, 'model_name') else opts.module_name)
return patterns('',
url('^$', self.admin_site.admin_view(self.filebrowser_view), name='{0}_{1}_changelist'.format(*info)),
)
Expand Down

0 comments on commit a272cf1

Please sign in to comment.