mirror of
https://github.com/Hestia-Homes/Model.git
synced 2026-06-08 11:17:27 +00:00
handlging edge case in search epc
This commit is contained in:
parent
b1631bbf7a
commit
10b1ef4b2a
1 changed files with 9 additions and 1 deletions
|
|
@ -551,7 +551,15 @@ class SearchEpc:
|
|||
# Take the uprn from the most recent
|
||||
uprns = {newest_epc["uprn"]}
|
||||
else:
|
||||
raise ValueError("Multiple UPRNs found - investigate me")
|
||||
# We check if we have UPRNs that match the one we're given and if so, filter on those
|
||||
if self.uprn is not None:
|
||||
uprns = {u for u in uprns if int(u) == self.uprn}
|
||||
if len(uprns) == 1:
|
||||
logger.info(
|
||||
f"Multiple UPRNs found but one matches provided UPRN {self.uprn}, using this UPRN"
|
||||
)
|
||||
else:
|
||||
raise ValueError("Multiple UPRNs found - investigate me")
|
||||
|
||||
# if uprns:
|
||||
# epc_uprn = uprns.pop()
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue