fix: Finish refactoring LiaisonModelForm subclasses without BetterModelForm
This commit is contained in:
parent
4f443cc445
commit
1015cf83f8
|
@ -468,14 +468,6 @@ class OutgoingLiaisonForm(LiaisonModelForm):
|
||||||
class Meta:
|
class Meta:
|
||||||
model = LiaisonStatement
|
model = LiaisonStatement
|
||||||
exclude = ('attachments','state','from_name','to_name','action_holder_contacts')
|
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):
|
def is_approved(self):
|
||||||
return self.cleaned_data['approved']
|
return self.cleaned_data['approved']
|
||||||
|
|
|
@ -53,12 +53,17 @@
|
||||||
{% bootstrap_field form.from_groups layout="horizontal" %}
|
{% bootstrap_field form.from_groups layout="horizontal" %}
|
||||||
{% bootstrap_field form.from_contact layout="horizontal" %}
|
{% bootstrap_field form.from_contact layout="horizontal" %}
|
||||||
{% bootstrap_field form.response_contacts layout="horizontal" %}
|
{% bootstrap_field form.response_contacts layout="horizontal" %}
|
||||||
|
{% if form.approved %}
|
||||||
|
{% bootstrap_field form.approved layout="horizontal" %}
|
||||||
|
{% endif %}
|
||||||
<h2>To</h2>
|
<h2>To</h2>
|
||||||
{% bootstrap_field form.to_groups layout="horizontal" %}
|
{% bootstrap_field form.to_groups layout="horizontal" %}
|
||||||
{% bootstrap_field form.to_contacts layout="horizontal" %}
|
{% bootstrap_field form.to_contacts layout="horizontal" %}
|
||||||
<h2>Other email addresses</h2>
|
<h2>Other email addresses</h2>
|
||||||
{% bootstrap_field form.technical_contacts layout="horizontal" %}
|
{% 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" %}
|
{% bootstrap_field form.cc_contacts layout="horizontal" %}
|
||||||
<h2>Purpose</h2>
|
<h2>Purpose</h2>
|
||||||
{% bootstrap_field form.purpose layout="horizontal" %}
|
{% bootstrap_field form.purpose layout="horizontal" %}
|
||||||
|
|
Loading…
Reference in a new issue