Skip to content

Commit

Permalink
region fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderGi committed Oct 3, 2023
1 parent 8c55353 commit 462b197
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions recipes/QRCodeGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -776,11 +776,19 @@ def get_account_info_from_email(email: str):
if photo_url and name and url and title and company and gender and notes:
return photo_url, name, url, title, company, gender, notes

r = requests.get(
f"https://api.us-east-1-main.seon.io/SeonRestService/email-api/v2.2/{email}",
headers={"X-API-KEY": settings.SEON_API_KEY}, # type: ignore
)
r.raise_for_status()
try:
r = requests.get(
f"https://api.seon.io/SeonRestService/email-api/v2.2/{email}",
headers={"X-API-KEY": settings.SEON_API_KEY}, # type: ignore
)
r.raise_for_status()
except requests.exceptions.HTTPError:
## region fallback for US devs
r = requests.get(
f"https://api.us-east-1-main.seon.io/SeonRestService/email-api/v2.2/{email}",
headers={"X-API-KEY": settings.SEON_API_KEY}, # type: ignore
)
r.raise_for_status()

account_details = glom.glom(r.json(), "data.account_details", default={})
for spec in [
Expand Down

0 comments on commit 462b197

Please sign in to comment.