From 98842c1aa0c5e71cb6d861c19314a3d9895e5a11 Mon Sep 17 00:00:00 2001 From: zandercymatics <141044360+zandercymatics@users.noreply.github.com> Date: Wed, 30 Oct 2024 14:40:25 -0600 Subject: [PATCH] add comments --- src/registrar/forms/domain_request_wizard.py | 3 ++- src/registrar/views/domain_request.py | 7 +++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/registrar/forms/domain_request_wizard.py b/src/registrar/forms/domain_request_wizard.py index b27a004c0..c188a7ab0 100644 --- a/src/registrar/forms/domain_request_wizard.py +++ b/src/registrar/forms/domain_request_wizard.py @@ -154,7 +154,8 @@ def form_is_checked(self): desired suborg doesn't exist. We expose additional fields that denote this, 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(): return True elif self.domain_request.requesting_entity_is_portfolio(): diff --git a/src/registrar/views/domain_request.py b/src/registrar/views/domain_request.py index 7fb2d9b16..41e9a07b8 100644 --- a/src/registrar/views/domain_request.py +++ b/src/registrar/views/domain_request.py @@ -594,16 +594,19 @@ def save(self, forms: list): """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 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 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 sub_organization = cleaned_data.get("sub_organization") 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): # Cleanup the organization name field, as this isn't for suborganizations. requesting_entity_form.cleaned_data.update({"organization_name": None})