Skip to content

Commit

Permalink
Relocated suspension check to ensure that record exists
Browse files Browse the repository at this point in the history
Signed-off-by: Gavin Jaeger-Freeborn <[email protected]>
  • Loading branch information
Gavinok committed Sep 26, 2024
1 parent 970d344 commit 4659400
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,12 @@ async def setup_tenant_context(request: web.Request, handler):
rec = await TenantRecord.query_by_wallet_id(session, wallet_id)
LOGGER.debug(rec)
tenant_id = rec.tenant_id
# Ensure tokens are not associated with suspended tenants
if TenantRecord.STATE_DELETED == rec.state:
raise web.HTTPUnauthorized(reason="Tenant Is Suspended")

log_records_inject(tenant_id)

# Ensure tokens are not associated with suspended tenants
if TenantRecord.STATE_DELETED == rec.state:
raise web.HTTPUnauthorized(reason="Tenant Is Suspended")

return await handler(request)


Expand Down

0 comments on commit 4659400

Please sign in to comment.