mirror of
https://github.com/cisagov/manage.get.gov.git
synced 2025-08-01 07:26:34 +02:00
add comments
This commit is contained in:
parent
bb9cb527d2
commit
98842c1aa0
2 changed files with 7 additions and 3 deletions
|
@ -154,7 +154,8 @@ class RequestingEntityYesNoForm(BaseYesNoForm):
|
||||||
desired suborg doesn't exist. We expose additional fields that denote this,
|
desired suborg doesn't exist. We expose additional fields that denote this,
|
||||||
like `requested_suborganization`. So we also check on those.
|
like `requested_suborganization`. So we also check on those.
|
||||||
"""
|
"""
|
||||||
|
# True means that the requesting entity is a suborganization,
|
||||||
|
# whereas False means that the requesting entity is a portfolio.
|
||||||
if self.domain_request.requesting_entity_is_suborganization():
|
if self.domain_request.requesting_entity_is_suborganization():
|
||||||
return True
|
return True
|
||||||
elif self.domain_request.requesting_entity_is_portfolio():
|
elif self.domain_request.requesting_entity_is_portfolio():
|
||||||
|
|
|
@ -594,16 +594,19 @@ class RequestingEntity(DomainRequestWizard):
|
||||||
"""Override of save to clear or associate certain suborganization data
|
"""Override of save to clear or associate certain suborganization data
|
||||||
depending on what the user wishes to do. For instance, we want to add a suborganization
|
depending on what the user wishes to do. For instance, we want to add a suborganization
|
||||||
if the user selects one."""
|
if the user selects one."""
|
||||||
yesno_form = forms[0]
|
|
||||||
requesting_entity_form = forms[1]
|
|
||||||
|
|
||||||
|
# Get the yes/no dropdown value
|
||||||
|
yesno_form = forms[0]
|
||||||
yesno_cleaned_data = yesno_form.cleaned_data
|
yesno_cleaned_data = yesno_form.cleaned_data
|
||||||
requesting_entity_is_suborganization = yesno_cleaned_data.get("requesting_entity_is_suborganization")
|
requesting_entity_is_suborganization = yesno_cleaned_data.get("requesting_entity_is_suborganization")
|
||||||
|
|
||||||
|
# Get the suborg value, and the requested suborg value
|
||||||
|
requesting_entity_form = forms[1]
|
||||||
cleaned_data = requesting_entity_form.cleaned_data
|
cleaned_data = requesting_entity_form.cleaned_data
|
||||||
sub_organization = cleaned_data.get("sub_organization")
|
sub_organization = cleaned_data.get("sub_organization")
|
||||||
requested_suborganization = cleaned_data.get("requested_suborganization")
|
requested_suborganization = cleaned_data.get("requested_suborganization")
|
||||||
|
|
||||||
|
# Do some data cleanup, depending on what option was checked
|
||||||
if requesting_entity_is_suborganization and (sub_organization or requested_suborganization):
|
if requesting_entity_is_suborganization and (sub_organization or requested_suborganization):
|
||||||
# Cleanup the organization name field, as this isn't for suborganizations.
|
# Cleanup the organization name field, as this isn't for suborganizations.
|
||||||
requesting_entity_form.cleaned_data.update({"organization_name": None})
|
requesting_entity_form.cleaned_data.update({"organization_name": None})
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue