summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2022-01-25 14:17:37 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2022-12-12 12:20:59 +0100
commit2e09342dd159c3f06d277890274cf72a33d56221 (patch)
treefe72fceedca72c10321f6b42e4b3e95fe9d31a16
parent31ef78cec0cd2ba3ccc91c4bafd89831e73abe20 (diff)
downloadIshtar-2e09342dd159c3f06d277890274cf72a33d56221.tar.bz2
Ishtar-2e09342dd159c3f06d277890274cf72a33d56221.zip
Fix history parameters
-rw-r--r--ishtar_common/models_common.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py
index 0748a57cd..921b5d59b 100644
--- a/ishtar_common/models_common.py
+++ b/ishtar_common/models_common.py
@@ -1227,7 +1227,9 @@ class HistoricalRecords(BaseHistoricalRecords):
def _get_history_m2m(self):
q = model.objects.filter(pk=getattr(self, model._meta.pk.attname))
if q.count():
- return q.all()[0].history_m2m[attr]
+ item = q.all()[0]
+ if attr in item.history_m2m:
+ return item.history_m2m[attr]
return _get_history_m2m
def get_serialize_call(attr):