mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-07-26 04:28:39 +02:00
Edge cases
This commit is contained in:
parent
a9c91bc94a
commit
7a3f009713
2 changed files with 6 additions and 5 deletions
|
@ -1844,7 +1844,7 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
}
|
||||
|
||||
let inputFieldValue = inputField.value
|
||||
if (readonlyField && inputFieldValue){
|
||||
if (readonlyField && inputFieldValue || fieldName == "full_name"){
|
||||
if (fieldName == "full_name"){
|
||||
let firstName = document.querySelector(`#id_first_name`).value;
|
||||
let middleName = document.querySelector(`#id_middle_name`).value;
|
||||
|
@ -1855,8 +1855,6 @@ document.addEventListener('DOMContentLoaded', function() {
|
|||
}else {
|
||||
readonlyField.innerHTML = "Unknown";
|
||||
}
|
||||
}else {
|
||||
readonlyField.innerHTML = inputValue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -71,7 +71,7 @@ class UserProfileForm(forms.ModelForm):
|
|||
class FinishSetupProfileForm(UserProfileForm):
|
||||
"""Form for updating user profile."""
|
||||
|
||||
full_name = forms.CharField(required=True, label="Full name")
|
||||
full_name = forms.CharField(required=False, label="Full name")
|
||||
|
||||
def clean(self):
|
||||
cleaned_data = super().clean()
|
||||
|
@ -93,7 +93,10 @@ class FinishSetupProfileForm(UserProfileForm):
|
|||
self.fields["title"].label = "Title or role in your organization"
|
||||
|
||||
# Define the "full_name" value
|
||||
full_name = None
|
||||
full_name = ""
|
||||
if self.instance.first_name and self.instance.last_name:
|
||||
full_name = self.instance.get_formatted_name(return_unknown_when_none=False)
|
||||
self.fields["full_name"].initial = full_name
|
||||
|
||||
# Set full_name as required for styling purposes
|
||||
self.fields["full_name"].widget.attrs['required'] = 'required'
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue