Skip to content

Commit

Permalink
Add the missing .zip attribute to norm_long - removed in some version…
Browse files Browse the repository at this point in the history
…s of Docassemble without warning
  • Loading branch information
nonprofittechy committed Dec 27, 2024
1 parent 76ead20 commit 2a211f8
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions docassemble/AssemblyLine/al_general.py
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,9 @@ def normalized_address(self) -> Union[Address, "ALAddress"]:
Warning: currently the normalized address will not be redacted if the address is impounded.
This has the additional side effect of populating the .zip attribute with the postal_code
attribute if it exists.
Returns:
Union[Address, "ALAddress"]: Normalized address if geocoding is successful, otherwise
the original address.
Expand All @@ -635,6 +638,8 @@ def normalized_address(self) -> Union[Address, "ALAddress"]:
except:
pass
if self.was_geocoded_successfully() and hasattr(self, "norm_long"):
if hasattr(self.norm_long, "postal_code") and not hasattr(self.norm_long, "zip"):
self.norm_long.zip = self.norm_long.postal_code
return self.norm_long
return self

Expand Down

0 comments on commit 2a211f8

Please sign in to comment.