fix: Finish refactoring LiaisonModelForm subclasses without BetterModelForm

This commit is contained in:
Jennifer Richards 2023-05-10 18:47:36 -03:00
parent 4f443cc445
commit 1015cf83f8
No known key found for this signature in database
GPG key ID: 9B2BF5C5ADDA6A6E
2 changed files with 6 additions and 9 deletions

View file

@ -468,14 +468,6 @@ class OutgoingLiaisonForm(LiaisonModelForm):
class Meta:
model = LiaisonStatement
exclude = ('attachments','state','from_name','to_name','action_holder_contacts')
# add approved field, no action_holder_contacts
fieldsets = [('From', {'fields': ['from_groups','from_contact','response_contacts','approved'], 'legend': ''}),
('To', {'fields': ['to_groups','to_contacts'], 'legend': ''}),
('Other email addresses', {'fields': ['technical_contacts','cc_contacts'], 'legend': ''}),
('Purpose', {'fields':['purpose', 'deadline'], 'legend': ''}),
('Reference', {'fields': ['other_identifiers','related_to'], 'legend': ''}),
('Liaison Statement', {'fields': ['title', 'submitted_date', 'body', 'attachments'], 'legend': ''}),
('Add attachment', {'fields': ['attach_title', 'attach_file', 'attach_button'], 'legend': ''})]
def is_approved(self):
return self.cleaned_data['approved']

View file

@ -53,12 +53,17 @@
{% bootstrap_field form.from_groups layout="horizontal" %}
{% bootstrap_field form.from_contact layout="horizontal" %}
{% bootstrap_field form.response_contacts layout="horizontal" %}
{% if form.approved %}
{% bootstrap_field form.approved layout="horizontal" %}
{% endif %}
<h2>To</h2>
{% bootstrap_field form.to_groups layout="horizontal" %}
{% bootstrap_field form.to_contacts layout="horizontal" %}
<h2>Other email addresses</h2>
{% bootstrap_field form.technical_contacts layout="horizontal" %}
{% bootstrap_field form.action_holder_contacts layout="horizontal" %}
{% if form.action_holder_contacts %}
{% bootstrap_field form.action_holder_contacts layout="horizontal" %}
{% endif %}
{% bootstrap_field form.cc_contacts layout="horizontal" %}
<h2>Purpose</h2>
{% bootstrap_field form.purpose layout="horizontal" %}