feat: Make proper animal edit form

This commit is contained in:
2025-06-16 23:03:22 +02:00
parent e132b1c9f6
commit 35ef6676a2
3 changed files with 14 additions and 18 deletions

View File

@@ -84,19 +84,7 @@ class AdoptionNoticeFormWithDateWidget(AdoptionNoticeForm):
class AnimalForm(forms.ModelForm):
def __init__(self, *args, **kwargs):
if 'in_adoption_notice_creation_flow' in kwargs:
adding = kwargs.pop('in_adoption_notice_creation_flow')
else:
adding = False
super().__init__(*args, **kwargs)
self.helper = FormHelper()
self.helper.form_class = 'form-animal card'
if adding:
self.helper.add_input(Submit('save-and-add-another-animal', _('Speichern und weiteres Tier hinzufügen')))
self.helper.add_input(Submit('save-and-finish', _('Speichern und beenden')))
else:
self.helper.add_input(Submit('submit', _('Speichern'), css_class="btn"))
template_name = "fellchensammlung/forms/form_snippets.html"
class Meta:
model = Animal