Skip to content

Commit 75cf06e

Browse files
committed
get_error_detail: use error_list to get code(s)
1 parent 1664588 commit 75cf06e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

rest_framework/fields.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,8 +234,9 @@ def get_error_detail(exc_info):
234234
"""
235235
code = getattr(exc_info, 'code', None) or 'invalid'
236236
return [
237-
ErrorDetail(msg, code=code)
238-
for msg in exc_info.messages
237+
ErrorDetail(error.message % (error.params or ()),
238+
code=error.code if error.code else code)
239+
for error in exc_info.error_list
239240
]
240241

241242

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy