From 9a6f1dccc4e24467e73dd2a9bb5f7e81b1116d19 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Thu, 6 Jul 2023 12:48:33 +0200 Subject: 🐛 wizards: fix autofocus of first field MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/wizards.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'ishtar_common/wizards.py') diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index 475c426bb..aa5e1804d 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -1227,7 +1227,8 @@ class Wizard(IshtarWizard): first_field = None for key in frm.fields: field = frm.fields[key] - if not field.widget.input_type == "hidden": + if not hasattr(field.widget, "input_type") \ + or not field.widget.input_type == "hidden": first_field = field break if first_field: -- cgit v1.2.3