mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-28 21:46:33 +02:00
Fix bug with senior_official in django admin, add readonly
This commit is contained in:
parent
3e992f9ec8
commit
2863e29d96
3 changed files with 5 additions and 4 deletions
|
@ -504,8 +504,6 @@ class AdminSortFields:
|
|||
# == Contact == #
|
||||
"other_contacts": (Contact, _name_sort),
|
||||
"submitter": (Contact, _name_sort),
|
||||
# == Senior Official == #
|
||||
"senior_official": (SeniorOfficial, _name_sort),
|
||||
# == User == #
|
||||
"creator": (User, _name_sort),
|
||||
"user": (User, _name_sort),
|
||||
|
|
|
@ -321,10 +321,13 @@ class SeniorOfficialContactForm(ContactForm):
|
|||
"""Form for updating senior official contacts."""
|
||||
|
||||
JOIN = "senior_official"
|
||||
|
||||
full_name = forms.CharField(label="Full name", required=False)
|
||||
def __init__(self, disable_fields=False, *args, **kwargs):
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
if self.instance:
|
||||
self.fields["full_name"].initial = self.instance.get_formatted_name()
|
||||
|
||||
# Overriding bc phone not required in this form
|
||||
self.fields["phone"] = forms.IntegerField(required=False)
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ class PortfolioSeniorOfficialForm(forms.ModelForm):
|
|||
"""
|
||||
|
||||
JOIN = "senior_official"
|
||||
full_name = forms.CharField(label="Full name")
|
||||
full_name = forms.CharField(label="Full name", required=False)
|
||||
class Meta:
|
||||
model = SeniorOfficial
|
||||
fields = [
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue