mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 17:09:59 +03:00
Add check if exc.detail is instance of tuple
This commit is contained in:
parent
13c379c189
commit
d1ebf825c6
|
@ -90,7 +90,7 @@ def exception_handler(exc, context):
|
|||
if getattr(exc, 'wait', None):
|
||||
headers['Retry-After'] = '%d' % exc.wait
|
||||
|
||||
if isinstance(exc.detail, (list, dict)):
|
||||
if isinstance(exc.detail, (list, tuple, dict)):
|
||||
data = exc.detail
|
||||
else:
|
||||
data = {'detail': exc.detail, 'code': exc.detail.code}
|
||||
|
|
Loading…
Reference in New Issue
Block a user