File tree 1 file changed +7
-1
lines changed
1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change 2
2
from django .utils import six , encoding
3
3
from django .utils .translation import ugettext_lazy as _
4
4
from rest_framework import status , exceptions
5
- from rest_framework .views import exception_handler as drf_exception_handler
6
5
7
6
from rest_framework_json_api .utils import format_value
8
7
9
8
10
9
def 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
11
17
response = drf_exception_handler (exc , context )
12
18
13
19
if not response :
You can’t perform that action at this time.
0 commit comments