Skip to content

Commit

Permalink
protect against not being in admin group
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanmcreynolds committed Apr 25, 2024
1 parent 739a16b commit 2f919b4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion alshub/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ async def get_staff_beamlines(ac: AsyncClient, orcid: str, email: str) -> List[s
# ALSHub
beamlines = set()
if ADMINS:
beamlines.update(ADMINS[email])
admin = ADMINS.get(email)
if admin:
beamlines.update(ADMINS.get(email))
if response.is_error:
info(f"error asking ALHub for staff roles {orcid}")
return beamlines
Expand Down

0 comments on commit 2f919b4

Please sign in to comment.