mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-28 05:26:28 +02:00
Cleanup unused content
This commit is contained in:
parent
3837359977
commit
0218da50d8
3 changed files with 13 additions and 61 deletions
|
@ -98,14 +98,8 @@ class PortfolioSeniorOfficialForm(forms.ModelForm):
|
|||
"full_name": forms.TextInput(attrs={"readonly": "readonly"})
|
||||
}
|
||||
|
||||
# the database fields have blank=True so ModelForm doesn't create
|
||||
# required fields by default. Use this list in __init__ to mark each
|
||||
# of these fields as required
|
||||
required = ["first_name", "last_name", "title", "email"]
|
||||
def __init__(self, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
for field_name in self.required:
|
||||
self.fields[field_name].required = True
|
||||
|
||||
if self.instance:
|
||||
self.fields["full_name"].initial = self.instance.get_formatted_name()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue