Skip to content

Commit

Permalink
improved companies house variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jenriordan committed Aug 16, 2024
1 parent 3c51592 commit ded37f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
2 changes: 2 additions & 0 deletions django_app/apply_for_a_licence/views/views_end.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ def form_valid(self, form: DeclarationForm) -> HttpResponse:
if (
cleaned_data["is_the_business_registered_with_companies_house"].get("business_registered_on_companies_house", "")
== "yes"
and cleaned_data["do_you_know_the_registered_company_number"].get("do_you_know_the_registered_company_number", "")
== "yes"
):
is_on_companies_house = True

Expand Down
11 changes: 2 additions & 9 deletions django_app/utils/save_to_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,7 @@ def save_applicant(self) -> Applicant:
)

# business journey
elif (
self.is_on_companies_house
and self.data["do_you_know_the_registered_company_number"]["do_you_know_the_registered_company_number"] == "yes"
and not self.is_third_party
):
elif self.is_on_companies_house and not self.is_third_party:
return self.applicant.create(
user_email_address=self.data["what_is_your_email"],
user_email_verification=self.email_verification,
Expand Down Expand Up @@ -206,10 +202,7 @@ def save_business(self, business: Organisation) -> None:
)

# business journey company details
elif (
self.is_on_companies_house
and self.data["do_you_know_the_registered_company_number"]["do_you_know_the_registered_company_number"] == "yes"
):
elif self.is_on_companies_house:
business.create(
licence=self.licence,
name=self.data["do_you_know_the_registered_company_number"]["registered_company_name"],
Expand Down

0 comments on commit ded37f6

Please sign in to comment.