summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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
commit49d001f7620ad4bf6ca8a12cfc2d55109d3f6358 (patch)
tree814c335028fe9de7b845cd2bb4aea55590b81f6e
parent2368d17bed1813b958b97f173426ed35acdf1afc (diff)
downloadIshtar-49d001f7620ad4bf6ca8a12cfc2d55109d3f6358.tar.bz2
Ishtar-49d001f7620ad4bf6ca8a12cfc2d55109d3f6358.zip
Fix modify link on site sheet (refs #4328)
-rw-r--r--archaeological_operations/models.py1
-rw-r--r--ishtar_common/templatetags/window_header.py10
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,