Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
allgo
allgo
Commits
a3c9772f
Commit
a3c9772f
authored
Mar 18, 2020
by
BAIRE Anthony
Browse files
make the api job creation errors a bit more human-friendly
(do not display the exception type)
parent
a74d3847
Changes
1
Hide whitespace changes
Inline
Side-by-side
django/allgo/api/v1/views.py
View file @
a3c9772f
...
...
@@ -76,7 +76,7 @@ def jobs(request):
try
:
job
.
save
()
except
ValidationError
as
e
:
return
JsonResponse
({
'error'
:
"Invalid parameters: %s"
%
e
.
error
_dict
},
status
=
400
)
return
JsonResponse
({
'error'
:
"Invalid parameters: %s"
%
e
.
message
_dict
},
status
=
400
)
# FIXME: possible infoleak: because we have ATOMIC_REQUESTS=True the
# current id can be reused for another job in case anything fails before
...
...
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