Enhance ConditionForm: add Crispy Forms integration for consistent submit button rendering

This commit is contained in:
Ross
2025-11-17 23:15:21 +00:00
parent a12a9e38f3
commit 21de543313
+12
View File
@@ -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: