Eliminate all of the exceptions when running the tests.
This commit is contained in:
parent
e1b704bdac
commit
6f39e158d6
10 changed files with 50 additions and 10 deletions
|
@ -66,6 +66,10 @@ class OrganizationList(ApiResource):
|
|||
@validate_json_request('NewOrg')
|
||||
def post(self):
|
||||
""" Create a new organization. """
|
||||
user = get_authenticated_user()
|
||||
if not user:
|
||||
raise Unauthorized()
|
||||
|
||||
org_data = request.get_json()
|
||||
existing = None
|
||||
|
||||
|
@ -85,7 +89,7 @@ class OrganizationList(ApiResource):
|
|||
raise request_error(message=msg)
|
||||
|
||||
try:
|
||||
model.create_organization(org_data['name'], org_data['email'], get_authenticated_user())
|
||||
model.create_organization(org_data['name'], org_data['email'], user)
|
||||
return 'Created', 201
|
||||
except model.DataModelException as ex:
|
||||
raise request_error(exception=ex)
|
||||
|
|
Reference in a new issue