Merge "Fix the issue when trying to show user."
This commit is contained in:
commit
aabb1c7317
@ -123,7 +123,7 @@ def user_get(context, user_id, show_deleted=False, tenant_safe=True):
|
||||
if user is None or user.deleted_at is not None and not deleted_ok:
|
||||
return None
|
||||
|
||||
if tenant_safe and context.tenant_id != user.user_id:
|
||||
if tenant_safe and context.tenant_id != user.id:
|
||||
return None
|
||||
|
||||
return user
|
||||
|
@ -115,6 +115,8 @@ class User(object):
|
||||
def load(cls, context, user_id=None, user=None, realtime=False,
|
||||
show_deleted=False, tenant_safe=True):
|
||||
'''Retrieve a user from database.'''
|
||||
if context.is_admin:
|
||||
tenant_safe = False
|
||||
if user is None:
|
||||
user = db_api.user_get(context, user_id,
|
||||
show_deleted=show_deleted,
|
||||
|
Loading…
Reference in New Issue
Block a user