* fix(DB): allow null session_id for assist_records(session_id)

* fix(chalice): fixed missing-user access
This commit is contained in:
Kraiem Taha Yassine 2024-03-18 11:47:44 +01:00 committed by GitHub
parent 39f8602c76
commit 8c41e6cda8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View file

@ -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'])
@ -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,

View file

@ -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,