This commit is contained in:
Kyle Amos 2018-04-20 17:50:06 +00:00 committed by GitHub
commit 5765780474
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -209,6 +209,12 @@ class NotAcceptable(APIException):
super(NotAcceptable, self).__init__(detail, code) 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): class UnsupportedMediaType(APIException):
status_code = status.HTTP_415_UNSUPPORTED_MEDIA_TYPE status_code = status.HTTP_415_UNSUPPORTED_MEDIA_TYPE
default_detail = _('Unsupported media type "{media_type}" in request.') default_detail = _('Unsupported media type "{media_type}" in request.')