Verified Commit 3730157e authored by Peter Stanko's avatar Peter Stanko
Browse files

Fixed the review creation

parent 93359527
Pipeline #31680 passed with stage
in 7 minutes and 12 seconds
......@@ -1002,6 +1002,12 @@ class ReviewItem(db.Model, EntityBase):
"""
return self.line_start
@line.setter
def line(self, line):
self.line_start = line
if self.line_end is None:
self.line_end = line
def __eq__(self, other):
return self.id == other.id
......
......@@ -86,4 +86,6 @@ def handle_portal_api_error(ex: PortalAPIError):
@rest_api.errorhandler(Exception)
def handle_default_exception(ex: Exception):
log.critical(f"[ERROR] Fatal error: {ex}")
if flask.current_app.config.get('TESTING') is True:
raise ex
return send_response({'message': str(ex)}), 500
......@@ -319,7 +319,7 @@ class ReviewItemSchema(BaseSchema, Schema):
line = fields.Int(allow_none=True)
line_start = fields.Int(allow_none=True)
line_end = fields.Int(allow_none=True)
review = NESTED('Review', onlyi=('id', 'submission.id'))
review = NESTED('Review', only=('id', 'submission.id'))
user = NESTED['user']
......
Supports Markdown
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