mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-02 11:30:12 +03:00
Added exception class for HTTP 409 responses
This commit is contained in:
parent
7d64b7016d
commit
675a9090ab
|
@ -209,6 +209,12 @@ class NotAcceptable(APIException):
|
|||
super(NotAcceptable, self).__init__(detail, code)
|
||||
|
||||
|
||||
class Conflict(APIException):
|
||||
status_code = status.HTTP_409_CONFLICT
|
||||
default_detail = _('Conflict with the current state of the target resource.')
|
||||
default_code = 'conflict'
|
||||
|
||||
|
||||
class UnsupportedMediaType(APIException):
|
||||
status_code = status.HTTP_415_UNSUPPORTED_MEDIA_TYPE
|
||||
default_detail = _('Unsupported media type "{media_type}" in request.')
|
||||
|
|
Loading…
Reference in New Issue
Block a user