Skip to content

Commit 6cfad80

Browse files
committed
Added Conflict APIException
1 parent 04738fa commit 6cfad80

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

rest_framework_json_api/exceptions.py

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
2-
from django.utils import six, encoding
1+
from django.utils import encoding
2+
from django.utils.translation import ugettext_lazy as _
3+
from rest_framework import status
4+
from rest_framework.exceptions import APIException
35
from rest_framework.views import exception_handler as drf_exception_handler
6+
47
from rest_framework_json_api.utils import format_value
58

69

@@ -39,3 +42,8 @@ def exception_handler(exc, context):
3942
context['view'].resource_name = 'errors'
4043
response.data = errors
4144
return response
45+
46+
47+
class Conflict(APIException):
48+
status_code = status.HTTP_409_CONFLICT
49+
default_detail = _('Conflict.')

0 commit comments

Comments
 (0)