Dev (#1968)
* fix(DB): allow null session_id for assist_records(session_id) * fix(chalice): fixed missing-user access
This commit is contained in:
parent
39f8602c76
commit
8c41e6cda8
2 changed files with 10 additions and 1 deletions
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue