From ca98a99c8543fb820e5052839d82b02ad302de9a Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Sat, 24 Dec 2016 13:17:23 +0100 Subject: Container creation form (refs #3392) --- ishtar_common/wizards.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'ishtar_common/wizards.py') diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index ad16ce0e1..55d1224bf 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -489,7 +489,6 @@ class Wizard(NamedUrlWizardView): if k.startswith('pk'): continue if k not in obj.__class__._meta.get_all_field_names(): - print(k, obj.__class__._meta.get_all_field_names()) continue # False set to None for images and files if not k.endswith('_id') and ( @@ -568,6 +567,11 @@ class Wizard(NamedUrlWizardView): dct[dependant_item] = c_item if 'pk' in dct: dct.pop('pk') + # remove non relevant fields + all_field_names = self.get_saved_model()._meta.get_all_field_names() + for k in dct.copy(): + if k not in all_field_names: + dct.pop(k) saved_args = self.saved_args.copy() for k in saved_args: if k in dct: -- cgit v1.2.3