File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 22from django .utils import six , encoding
33from django .utils .translation import ugettext_lazy as _
44from rest_framework import status , exceptions
5- from rest_framework .views import exception_handler as drf_exception_handler
65
76from rest_framework_json_api .utils import format_value
87
98
109def exception_handler (exc , context ):
10+ # Import this here to avoid potential edge-case circular imports, which
11+ # crashes with:
12+ # "ImportError: Could not import 'rest_framework_json_api.parsers.JSONParser' for API setting
13+ # 'DEFAULT_PARSER_CLASSES'. ImportError: cannot import name 'exceptions'.'"
14+ #
15+ # Also see: https://github.com/django-json-api/django-rest-framework-json-api/issues/158
16+ from rest_framework .views import exception_handler as drf_exception_handler
1117 response = drf_exception_handler (exc , context )
1218
1319 if not response :
You can’t perform that action at this time.
0 commit comments