From 56d15235cf3a4867a1887f6d6d82798874c4e2e1 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 19 Jan 2017 20:27:29 +0100 Subject: Find form: fix period saving. --- 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 87a126879..18336cff5 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -634,7 +634,11 @@ class Wizard(NamedUrlWizardView): if type(value) == dict: model = related_model.model if hasattr(related_model, 'through') and \ - related_model.through: + related_model.through and \ + hasattr(related_model.through, 'RELATIVE_MODELS') \ + and self.get_saved_model() in \ + related_model.through.RELATIVE_MODELS: + # the form is dealing with the through parameter model = related_model.through # not m2m -> foreign key if not hasattr(related_model, 'clear'): -- cgit v1.2.3