Use user.id to check if user is in application
This commit is contained in:
@@ -7,7 +7,7 @@ from atst.models import EnvironmentRole
|
||||
class EnvironmentRoles(object):
|
||||
@classmethod
|
||||
def create(cls, user, environment, role):
|
||||
if environment.application.has_member(user):
|
||||
if environment.application.has_member(user.id):
|
||||
env_role = EnvironmentRole(user=user, environment=environment, role=role)
|
||||
if not user.cloud_id:
|
||||
user.cloud_id = app.csp.cloud.create_user(user)
|
||||
|
||||
@@ -68,7 +68,7 @@ class Environments(object):
|
||||
def update_env_role(cls, environment, user, new_role):
|
||||
updated = False
|
||||
|
||||
if environment.application.has_member(user):
|
||||
if environment.application.has_member(user.id):
|
||||
if new_role is None:
|
||||
updated = EnvironmentRoles.delete(user.id, environment.id)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user