Skip to content

Commit

Permalink
rm
Browse files Browse the repository at this point in the history
  • Loading branch information
NvdLaan authored and remyvdwereld committed Nov 21, 2024
1 parent f77abc7 commit 1832ed4
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions app/apps/addresses/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,17 +83,7 @@ def get_bag_address_data(self):
bag_search_response = do_bag_search_by_bag_id(self.bag_id)
bag_search_results = bag_search_response.get("response", {}).get("docs", [])
if bag_search_results:
# A BAG search will return an array with 1 or more results.
# There could be a "Nevenadres" so check addresses for "Hoofdadres".

found_address = None
for address in bag_search_results:
if address.get("type_adres") == "Hoofdadres":
found_address = address
break # Found first desired object so break the loop.

found_bag_data = found_address or bag_search_results[0]

found_bag_data = bag_search_results[0]
self.postal_code = found_bag_data.get("postcode", "")
self.street_name = found_bag_data.get("straatnaam", "")
self.number = found_bag_data.get("huisnummer", "")
Expand Down

0 comments on commit 1832ed4

Please sign in to comment.