Skip to content

Commit

Permalink
[admin] Hardcoding app_label simplifies reusability
Browse files Browse the repository at this point in the history
  • Loading branch information
nemesifier committed Nov 29, 2017
1 parent dcd4b87 commit 183eec2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion django_loci/base/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,10 @@ class AbstractLocationAdmin(TimeReadonlyAdminMixin, LeafletGeoAdmin):
save_on_top = True

def get_urls(self):
app_label = self.model._meta.app_label
# hardcoding django_loci as the prefix for the
# view names makes it much easier to extend
# without having to change templates
app_label = 'django_loci'
return [
url(r'^(?P<pk>[^/]+)/json/$',
self.admin_site.admin_view(self.json_view),
Expand Down

0 comments on commit 183eec2

Please sign in to comment.