From d1ebf825c6d7d4bf11a3a69a4df66fcfcd6addad Mon Sep 17 00:00:00 2001 From: jun0jang Date: Wed, 6 Nov 2019 16:13:01 +0900 Subject: [PATCH] Add check if exc.detail is instance of tuple --- rest_framework/views.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/views.py b/rest_framework/views.py index 490041f9e..f2b454093 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -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}