From c21edc6c6ec4838a44e4e4110ba2244bee5754e6 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 17 Mar 2025 12:48:26 +0100 Subject: 🐛 bulk update form: fix add button with new permissions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/widgets.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ishtar_common/widgets.py') diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 414cd7eab..765ed7b77 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -724,6 +724,11 @@ class JQueryAutoComplete(forms.TextInput): self.multiple = multiple self.limit = limit or {} self.dynamic_limit = dynamic_limit or [] + if (self.new or self.modify) and not self.associated_model: + raise AttributeError( + "JQueryAutoComplete - associated_model must be defined if new or " + "modify are set to True" + ) def value_from_datadict(self, data, files, name): v = data.get(name, None) -- cgit v1.2.3