From 8d1c4fc1363ad793ff0b08105cffb2fdda3d97fd Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 19 Jan 2017 11:29:03 +0100 Subject: Work on fix for treatment save (refs #3418) --- ishtar_common/wizards.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ishtar_common/wizards.py') diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index ce1333c89..87a126879 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -571,7 +571,10 @@ class Wizard(NamedUrlWizardView): all_field_names = self.get_saved_model()._meta.get_all_field_names() for k in dct.copy(): if not (k.endswith('_id') and k[:-3] in all_field_names) \ - and k not in all_field_names: + and k not in all_field_names and \ + (not hasattr(self.get_saved_model(), + 'EXTRA_SAVED_KEYS') or + k not in self.get_saved_model().EXTRA_SAVED_KEYS): dct.pop(k) saved_args = self.saved_args.copy() for k in saved_args: @@ -687,7 +690,9 @@ class Wizard(NamedUrlWizardView): return return_object and (obj, res) or res def get_deleted(self, keys): - """Get the deleted and non-deleted items in formsets""" + """ + Get the deleted and non-deleted items in formsets + """ not_to_delete, to_delete = set(), set() for key in keys: items = key.split('-') -- cgit v1.2.3