summaryrefslogtreecommitdiff
path: root/ishtar_common
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2019-01-07 12:06:07 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2019-01-11 17:30:46 +0100
commite9f6af279c98260e2bd81d1a4b34f000e9469636 (patch)
treec2d3b328e45b85a4440c7ad4cc8cd6e781c18a2f /ishtar_common
parenta87eb643c09fb8af86c0b7198cccd097eef1aac6 (diff)
downloadIshtar-e9f6af279c98260e2bd81d1a4b34f000e9469636.tar.bz2
Ishtar-e9f6af279c98260e2bd81d1a4b34f000e9469636.zip
Tests: M2M history on finds - save and display
Diffstat (limited to 'ishtar_common')
-rw-r--r--ishtar_common/models.py6
-rw-r--r--ishtar_common/templatetags/link_to_window.py1
2 files changed, 5 insertions, 2 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 319f19539..c7223c898 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -175,9 +175,13 @@ class HistoricalRecords(BaseHistoricalRecords):
q = q_history.filter(history_date__isnull=False,
history_date__gt=min_history_date) \
.order_by('-history_date', '-history_id')
- if q.count():
+ force = getattr(instance, "_force_history", False)
+ if not force and q.count():
return
+ if force:
+ delattr(instance, '_force_history')
+
if 'history_date' not in attrs or not attrs['history_date']:
attrs['history_date'] = datetime.datetime.now()
# record a new version only if data have been changed
diff --git a/ishtar_common/templatetags/link_to_window.py b/ishtar_common/templatetags/link_to_window.py
index 892492895..439602665 100644
--- a/ishtar_common/templatetags/link_to_window.py
+++ b/ishtar_common/templatetags/link_to_window.py
@@ -30,7 +30,6 @@ def link_to_window(item, context):
else:
return u""
if not item.can_view(request):
- print(item, "NOK3")
return u""
return simple_link_to_window(item)