Merge branch 'swaggerlikeus' of https://bitbucket.org/yackob03/quay into swaggerlikeus

This commit is contained in:
Joseph Schorr 2014-03-18 16:46:28 -04:00
commit b0dcb5d7e3
10 changed files with 50 additions and 10 deletions

View file

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