diff options
-rw-r--r-- | archaeological_operations/models.py | 1 | ||||
-rw-r--r-- | ishtar_common/templatetags/window_header.py | 10 |
2 files changed, 9 insertions, 2 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 872d2bf4e..8d2c4e376 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -108,6 +108,7 @@ class ArchaeologicalSite(BaseHistorizedItem, OwnPerms, ValueGetter, SHOW_URL = 'show-site' TABLE_COLS = ['reference', 'name', 'towns_label', 'periods', 'remains'] SLUG = 'site' + LONG_SLUG = 'archaeologicalsite' BASE_SEARCH_VECTORS = [ "comment", diff --git a/ishtar_common/templatetags/window_header.py b/ishtar_common/templatetags/window_header.py index 18dc793bf..f6fc27082 100644 --- a/ishtar_common/templatetags/window_header.py +++ b/ishtar_common/templatetags/window_header.py @@ -10,8 +10,14 @@ def window_nav(context, item, window_id, show_url, modify_url='', histo_url='', extra_actions = [] if hasattr(item, 'get_extra_actions'): extra_actions = item.get_extra_actions(context['request']) - if modify_url and hasattr(item, 'can_do') and hasattr(item, 'SLUG') and \ - not item.can_do(context['request'], 'change_' + item.SLUG): + + slug = None + if hasattr(item, "LONG_SLUG"): + slug = item.LONG_SLUG + elif hasattr(item, "SLUG"): + slug = item.SLUG + if modify_url and hasattr(item, 'can_do') and slug and \ + not item.can_do(context['request'], 'change_' + slug): modify_url = "" return { 'show_url': show_url, |