Merge "Fix the issue when trying to show user."

This commit is contained in:
Jenkins 2016-01-27 08:52:16 +00:00 committed by Gerrit Code Review
commit aabb1c7317
2 changed files with 3 additions and 1 deletions

View File

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

View File

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