Verified Commit 3ace4573 authored by Kristyna Pekarkova's avatar Kristyna Pekarkova Committed by Peter Stanko
Browse files

Added method for review item versions

parent 0056fe22
......@@ -380,3 +380,23 @@ class SubmissionReviewItem(CustomResource):
item = self.find.review_item(rid)
review = self.facades.reviews.delete_item(item=item)
return SCHEMAS.dump('review', review), 204
@submissions_namespace.route('/<string:sid>/review/<string:rid>/versions')
@submissions_namespace.param('sid', 'Submission id')
@submissions_namespace.param('rid', 'Review item id')
@submissions_namespace.response(404, 'Submissions not found')
@submissions_namespace.response(404, 'Review item not found')
class SubmissionReviewItemVersions(CustomResource):
@jwt_required
def get(self, sid: str, rid: str):
submission = self.find.submission(sid)
course = submission.project.course
log.debug(f"[REST] Get submission review versions"
f" by {self.client.log_name}: {submission.log_name}")
self.permissions(course=course).require.read_submission(submission)
item = self.find.review_item(rid)
versions = item.versions.all()
return SCHEMAS.dump('review_items', versions)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment