From 43363015fce53ac9dfaff63bf98a28c7161f5212 Mon Sep 17 00:00:00 2001 From: dandds Date: Thu, 27 Sep 2018 15:00:11 -0400 Subject: [PATCH] do not set default kwarg for atat role when creating users --- atst/domain/authnid/__init__.py | 4 +++- atst/domain/users.py | 2 +- atst/domain/workspaces/workspaces.py | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/atst/domain/authnid/__init__.py b/atst/domain/authnid/__init__.py index fb110193..fab6e722 100644 --- a/atst/domain/authnid/__init__.py +++ b/atst/domain/authnid/__init__.py @@ -31,7 +31,9 @@ class AuthenticationContext: except NotFoundError: email = self._get_user_email() - return Users.create(**{"email": email, **self.parsed_sdn}) + return Users.create( + atat_role_name="default", email=email, **self.parsed_sdn + ) def _get_user_email(self): try: diff --git a/atst/domain/users.py b/atst/domain/users.py index 64aa1e59..2eb7b0d9 100644 --- a/atst/domain/users.py +++ b/atst/domain/users.py @@ -28,7 +28,7 @@ class Users(object): return user @classmethod - def create(cls, atat_role_name="developer", **kwargs): + def create(cls, atat_role_name=None, **kwargs): atat_role = Roles.get(atat_role_name) try: diff --git a/atst/domain/workspaces/workspaces.py b/atst/domain/workspaces/workspaces.py index df2275a5..f8e2c560 100644 --- a/atst/domain/workspaces/workspaces.py +++ b/atst/domain/workspaces/workspaces.py @@ -85,6 +85,7 @@ class Workspaces(object): first_name=data["first_name"], last_name=data["last_name"], email=data["email"], + atat_role_name="default", ) return Workspaces.add_member(workspace, new_user, data["workspace_role"])