Skip to content

Commit

Permalink
get_error_detail: use error_list to get code(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
blueyed committed Jan 29, 2018
1 parent 1664588 commit 75cf06e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rest_framework/fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,8 +234,9 @@ def get_error_detail(exc_info):
"""
code = getattr(exc_info, 'code', None) or 'invalid'
return [
ErrorDetail(msg, code=code)
for msg in exc_info.messages
ErrorDetail(error.message % (error.params or ()),
code=error.code if error.code else code)
for error in exc_info.error_list
]


Expand Down

0 comments on commit 75cf06e

Please sign in to comment.