diff options
Diffstat (limited to 'archaeological_finds/wizards.py')
-rw-r--r-- | archaeological_finds/wizards.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/archaeological_finds/wizards.py b/archaeological_finds/wizards.py index c70721eac..f1d4a2dc4 100644 --- a/archaeological_finds/wizards.py +++ b/archaeological_finds/wizards.py @@ -177,13 +177,16 @@ class TreatmentBase(Wizard): finds = self.get_current_finds() if not finds: return initial - locations = [find.container.location.pk for find in finds if find.container] + locations = [find.container.location for find in finds if find.container] # no location or multiple locations if not locations or len(set(locations)) != 1: return initial if not initial: initial = {} - initial["location"] = locations[0] + default_location = locations[0] + initial["location"] = default_location.id + if default_location.organization: + initial["organization"] = default_location.organization_id return initial def get_extra_model(self, dct, m2m, form_list): |