mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-30 22:46:30 +02:00
Update portfolio.py
This commit is contained in:
parent
0218da50d8
commit
956e27cc77
1 changed files with 1 additions and 16 deletions
|
@ -76,30 +76,15 @@ class PortfolioSeniorOfficialForm(forms.ModelForm):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
JOIN = "senior_official"
|
JOIN = "senior_official"
|
||||||
full_name = forms.CharField(label="Full name", required=False)
|
full_name = forms.CharField(label="Full name")
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
model = SeniorOfficial
|
model = SeniorOfficial
|
||||||
fields = [
|
fields = [
|
||||||
"first_name",
|
|
||||||
"last_name",
|
|
||||||
"title",
|
"title",
|
||||||
"email",
|
"email",
|
||||||
]
|
]
|
||||||
widgets = {
|
|
||||||
# We need to set the required attributed for State/territory
|
|
||||||
# because for this fields we are creating an individual
|
|
||||||
# instance of the Select. For the other fields we use the for loop to set
|
|
||||||
# the class's required attribute to true.
|
|
||||||
"first_name": forms.TextInput,
|
|
||||||
"last_name": forms.TextInput,
|
|
||||||
"title": forms.TextInput,
|
|
||||||
"email": forms.TextInput,
|
|
||||||
"full_name": forms.TextInput(attrs={"readonly": "readonly"})
|
|
||||||
}
|
|
||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
if self.instance:
|
if self.instance:
|
||||||
self.fields["full_name"].initial = self.instance.get_formatted_name()
|
self.fields["full_name"].initial = self.instance.get_formatted_name()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue