From 729e62dc4706f70f14510ca89f2362ba600c5ad5 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 23 Feb 2024 18:43:16 +0100 Subject: ✨ Find - museum fields: bulk update MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/forms.py | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'ishtar_common') diff --git a/ishtar_common/forms.py b/ishtar_common/forms.py index 3dffc77c4..c59978730 100644 --- a/ishtar_common/forms.py +++ b/ishtar_common/forms.py @@ -192,6 +192,10 @@ class CustomForm(BSForm): except AttributeError: pass super().__init__(*args, **kwargs) + if hasattr(self, "fields"): + self.base_field_keys = self.fields.keys() + else: + self.base_field_keys = [] if not self._explicit_ordering: self.custom_form_ordering() @@ -1312,6 +1316,13 @@ class QAForm(CustomForm, ManageOldType): return setattr(item, key[3:], value) + def _get_organization(self, value): + try: + value = models.Organization.objects.get(pk=value).cached_label + except models.Organization.DoesNotExist: + return "" + return value + def save(self, items, user): for item in items: for base_key in self.cleaned_data: -- cgit v1.2.3