From 21de5433136d8e06f1181f1767a9e3975b04918f Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 17 Nov 2025 23:15:21 +0000 Subject: [PATCH] Enhance ConditionForm: add Crispy Forms integration for consistent submit button rendering --- atlas/forms.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/atlas/forms.py b/atlas/forms.py index 2d80f167..60fbda07 100755 --- a/atlas/forms.py +++ b/atlas/forms.py @@ -131,6 +131,18 @@ class ConditionForm(ModelForm): ), } + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + # Crispy helper to render a submit button consistently + try: + self.helper = FormHelper() + self.helper.form_method = "post" + self.helper.form_tag = True + self.helper.add_input(Submit("submit", "Submit")) + except Exception: + # If crispy not available or something goes wrong, don't break form + pass + class CaseCollectionForm(ModelForm): class Meta: