Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-submissions
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-submissions
Commits
e57b6755
Commit
e57b6755
authored
Jul 26, 2017
by
John Eskew
Committed by
GitHub
Jul 26, 2017
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #64 from edx/jeskew/log_more_info_on_error
Log the submission data when validator says invalid.
parents
4407659e
6504532f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
4 deletions
+7
-4
submissions/api.py
+7
-4
No files found.
submissions/api.py
View file @
e57b6755
...
...
@@ -990,18 +990,21 @@ def _get_or_create_student_item(student_item_dict):
return
StudentItem
.
objects
.
get
(
**
student_item_dict
)
except
StudentItem
.
DoesNotExist
:
student_item_serializer
=
StudentItemSerializer
(
data
=
student_item_dict
)
data
=
student_item_dict
)
if
not
student_item_serializer
.
is_valid
():
logger
.
error
(
"Invalid StudentItemSerializer: {}"
.
format
(
unicode
(
student_item_serializer
.
errors
)
u"Invalid StudentItemSerializer: errors:{} data:{}"
.
format
(
student_item_serializer
.
errors
,
student_item_dict
)
)
raise
SubmissionRequestError
(
field_errors
=
student_item_serializer
.
errors
)
return
student_item_serializer
.
save
()
except
DatabaseError
:
error_message
=
u"An error occurred creating student item: {}"
.
format
(
student_item_dict
)
student_item_dict
)
logger
.
exception
(
error_message
)
raise
SubmissionInternalError
(
error_message
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a 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