Skip to content

Commit

Permalink
Merge branch 'json-schema' of https://github.com/AI-READI/api.fairhub.io
Browse files Browse the repository at this point in the history
 into json-schema
  • Loading branch information
slugb0t committed Oct 12, 2023
2 parents 9ce4f11 + b3ab32d commit b42d4e2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions apis/study_metadata/study_contact.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,12 @@ def post(self, study_id: int):
],
},
}

try:
validate(request.json, schema)
except ValidationError as e:
return e.message, 400

study = Study.query.get(study_id)
if not is_granted("study_metadata", study):
return "Access denied, you can not delete study", 403
Expand Down
4 changes: 2 additions & 2 deletions apis/study_metadata/study_sponsors_collaborators.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,12 @@ def put(self, study_id: int):
"type": "array",
"items": {"type": "string"},
}

try:
validate(request.json, schema)
except ValidationError as e:
return e.message, 400

data = request.json
study_obj = Study.query.get(study_id)
if not is_granted("study_metadata", study_obj):
Expand Down

0 comments on commit b42d4e2

Please sign in to comment.