Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Kontr 2.0
Portal API Backend
Commits
3730157e
Verified
Commit
3730157e
authored
Apr 27, 2019
by
Peter Stanko
Browse files
Fixed the review creation
parent
93359527
Pipeline
#31680
passed with stage
in 7 minutes and 12 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
portal/database/models.py
View file @
3730157e
...
...
@@ -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
...
...
portal/rest/error_handlers.py
View file @
3730157e
...
...
@@ -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
portal/rest/schemas.py
View file @
3730157e
...
...
@@ -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'
,
only
i
=
(
'id'
,
'submission.id'
))
review
=
NESTED
(
'Review'
,
only
=
(
'id'
,
'submission.id'
))
user
=
NESTED
[
'user'
]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment