diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-11-22 22:51:32 +0100 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-11-28 11:40:17 +0100 | 
| commit | 257d2881457155c5c62d3bb0332ca886833b7ddf (patch) | |
| tree | 814c335028fe9de7b845cd2bb4aea55590b81f6e | |
| parent | 008343e5b2944ae34fd4b7c721b50bb414446b1d (diff) | |
| download | Ishtar-257d2881457155c5c62d3bb0332ca886833b7ddf.tar.bz2 Ishtar-257d2881457155c5c62d3bb0332ca886833b7ddf.zip | |
Fix modify link on site sheet (refs #4328)
| -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, | 
