summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-11-19 10:17:06 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-11-28 11:40:17 +0100
commitc8791afe348c41aedcba9abbc3014e5db9c875f8 (patch)
tree9419d2afb458f94c36c5e7434ba5c2625e37f45a /archaeological_finds
parentcdf6dea9e0c9cf099c7ee9594390a0ed6ce55107 (diff)
downloadIshtar-c8791afe348c41aedcba9abbc3014e5db9c875f8.tar.bz2
Ishtar-c8791afe348c41aedcba9abbc3014e5db9c875f8.zip
Treatment n<->1: copy and merge data
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/models_treatments.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/archaeological_finds/models_treatments.py b/archaeological_finds/models_treatments.py
index c7b888c0d..d92c98235 100644
--- a/archaeological_finds/models_treatments.py
+++ b/archaeological_finds/models_treatments.py
@@ -34,7 +34,8 @@ from ishtar_common.models import Document, GeneralType, \
ImageModel, BaseHistorizedItem, OwnPerms, HistoricalRecords, Person, \
Organization, ValueGetter, post_save_cache, ShortMenuItem, \
DashboardFormItem, ExternalIdManager
-from ishtar_common.utils import cached_label_changed, get_current_year
+from ishtar_common.utils import cached_label_changed, get_current_year, \
+ update_data
class TreatmentState(GeneralType):
@@ -351,6 +352,10 @@ class Treatment(DashboardFormItem, ValueGetter, BaseHistorizedItem,
current_documents.append(document.pk)
new_find.documents.add(document)
+ # data
+ new_find.data = update_data(new_find.data, upstream_item.data,
+ merge=True)
+
upstream_item.downstream_treatment = self
upstream_item.history_modifier = self.history_modifier
upstream_item.save()