Simplify logic and use better names

This commit is contained in:
zandercymatics 2024-10-30 11:22:39 -06:00
parent b09e0cad4b
commit bc8789bc1b
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7
11 changed files with 217 additions and 229 deletions

View file

@ -596,13 +596,13 @@ class RequestingEntity(DomainRequestWizard):
if the user selects one."""
requesting_entity_form = forms[1]
cleaned_data = requesting_entity_form.cleaned_data
is_suborganization = cleaned_data.get("is_suborganization")
requesting_entity_is_suborganization = cleaned_data.get("requesting_entity_is_suborganization")
sub_organization = cleaned_data.get("sub_organization")
requested_suborganization = cleaned_data.get("requested_suborganization")
# If no suborganization presently exists but the user filled out
# org information then create a suborg automatically.
if 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.
self.domain_request.organization_name = None
self.domain_request.sub_organization = sub_organization