Skip to content

Commit

Permalink
Merge pull request #218 from UKGovernmentBEIS/pc-500-address-bug
Browse files Browse the repository at this point in the history
PC-500: fix address bug
  • Loading branch information
Josh authored Sep 22, 2023
2 parents 87af01f + c6a45cf commit 98c4bce
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions help_to_heat/frontdoor/interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -376,11 +376,13 @@ def parse_dpa_to_address(self, dpa):
if "DEPENDENT_LOCALITY" in dpa:
line_1_parts.append(dpa["DEPENDENT_LOCALITY"].title())

if "DEPENDENT_THOROUGHFARE_NAME" and "THOROUGHFARE_NAME" in dpa:
line_1_parts.append(dpa["THOROUGHFARE_NAME"].title())
else:
if "DEPENDENT_THOROUGHFARE_NAME" in dpa:
line_1_parts.append(dpa["DEPENDENT_THOROUGHFARE_NAME"].title())
line_2_parts.insert(0, dpa["THOROUGHFARE_NAME"].title())
if "THOROUGHFARE_NAME" in dpa:
line_2_parts.insert(0, dpa["THOROUGHFARE_NAME"].title())
else:
if "THOROUGHFARE_NAME" in dpa:
line_1_parts.append(dpa["THOROUGHFARE_NAME"].title())

line1 = ", ".join(line for line in line_1_parts if line)
line2 = ", ".join(line for line in line_2_parts if line)
Expand Down

0 comments on commit 98c4bce

Please sign in to comment.