Added POST for organisation rest

This commit is contained in:
Ken Tsang
2017-07-06 11:02:13 +01:00
parent 2f8bc0feae
commit 76493a209c

View File

@@ -27,8 +27,8 @@ def get_organisation_by_id(org_id):
@organisation_blueprint.route('', methods=['POST'])
def post_organisation():
data = request.get_json()
if not data.get('name', None):
errors = {'name': ['Missing data for required field.']}
if not data.get('logo', None):
errors = {'logo': ['Missing data for required field.']}
raise InvalidRequest(errors, status_code=400)
# validate json with marshmallow