feat(api): fixed /accounts ambiguous tenant_id

This commit is contained in:
Taha Yassine Kraiem 2021-11-26 18:20:58 +01:00
parent 21a9d28bb8
commit b5e75c6f2e

View file

@ -266,8 +266,10 @@ def get(user_id, tenant_id):
LEFT JOIN public.roles USING (role_id)
WHERE
users.user_id = %(userId)s
AND tenant_id = %(tenantId)s
AND deleted_at IS NULL
AND users.tenant_id = %(tenantId)s
AND roles.tenant_id = %(tenantId)s
AND users.deleted_at IS NULL
AND (roles.role_id IS NULL or roles.deleted_at IS NULL)
LIMIT 1;""",
{"userId": user_id, "tenantId": tenant_id})
)