Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
* fix(DB): allow null session_id for assist_records(session_id)

* fix(chalice): fixed missing-user access
  • Loading branch information
tahayk authored Mar 18, 2024
1 parent 39f8602 commit 8c41e6c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion api/routers/core_dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ async def get_all_signup():
"edition": license.EDITION}}



if not tenants.tenants_exists_sync(use_pool=False):
@public_app.post('/signup', tags=['signup'])
@public_app.put('/signup', tags=['signup'])
Expand Down Expand Up @@ -101,10 +100,15 @@ def refresh_login(context: schemas.CurrentContext = Depends(OR_context)):
@app.get('/account', tags=['accounts'])
def get_account(context: schemas.CurrentContext = Depends(OR_context)):
r = users.get(tenant_id=context.tenant_id, user_id=context.user_id)
if r is None:
return {"errors": ["current user not found"]}
t = tenants.get_by_tenant_id(context.tenant_id)
if t is not None:
t["createdAt"] = TimeUTC.datetime_to_timestamp(t["createdAt"])
t["tenantName"] = t.pop("name")
else:
return {"errors": ["current tenant not found"]}

return {
'data': {
**r,
Expand Down
5 changes: 5 additions & 0 deletions ee/api/routers/core_dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,15 @@ def refresh_login(context: schemas.CurrentContext = Depends(OR_context)):
@app.get('/account', tags=['accounts'])
def get_account(context: schemas.CurrentContext = Depends(OR_context)):
r = users.get(tenant_id=context.tenant_id, user_id=context.user_id)
if r is None:
return {"errors": ["current user not found"]}
t = tenants.get_by_tenant_id(context.tenant_id)
if t is not None:
t["createdAt"] = TimeUTC.datetime_to_timestamp(t["createdAt"])
t["tenantName"] = t.pop("name")
else:
return {"errors": ["current tenant not found"]}

return {
'data': {
**r,
Expand Down

0 comments on commit 8c41e6c

Please sign in to comment.