Skip to content

Commit

Permalink
If an appconfig provides a custom verbose_name for the app, use that …
Browse files Browse the repository at this point in the history
…by preference.
  • Loading branch information
kezabelle committed Jun 23, 2018
1 parent a98206e commit 80d83dd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions haystackbrowser/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,12 @@ def get_additional_field_count(self):
def __getattr__(self, attr):
return getattr(self.object, attr)

def app_label(self):
try:
return self.object.model._meta.app_config.verbose_name
except AttributeError as e:
return self.object.app_label


class FacetWrapper(object):
"""
Expand Down

0 comments on commit 80d83dd

Please sign in to comment.