Skip to content

Commit

Permalink
adur_worthing_gov_uk address lookup cases insensitive
Browse files Browse the repository at this point in the history
  • Loading branch information
5ila5 committed Jan 27, 2024
1 parent f86e6ac commit 6895b57
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ def __init__(self, postcode, address):
self._address = address

def fetch(self):

if self._postcode is None or self._address is None:
raise ValueError("Either postcode or address is None")

Expand All @@ -43,7 +42,7 @@ def fetch(self):

found_address = None
for address in addresses_select.find_all("option"):
if self._address in address.get_text():
if self._address.upper() in address.get_text().upper():
found_address = address

if found_address is None:
Expand Down

2 comments on commit 6895b57

@jonathh21
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, I am not saying this is related, but my adur lookup stopped working recently, and this is the only change I can see.

The error i see in the logs is "Address not found" and that seemingly only occurs if no entry is found after the for loop.

Curiously, this change, which seem innocuous enough, appears to be to make it case insensitive - but i had a capitalised address all along and it worked fine.

Any word on what this was trying to solve?

@jonathh21
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interestingly - if i replace the variable usages in the urls for self._postcode and {address['value']} with actual values from adurs website.. it works fine.

Please sign in to comment.