diff --git a/rest_framework/exceptions.py b/rest_framework/exceptions.py index bc20fcaa3..037d071fd 100644 --- a/rest_framework/exceptions.py +++ b/rest_framework/exceptions.py @@ -203,7 +203,11 @@ class NotFound(APIException): default_detail = _('Not found.') default_code = 'not_found' - +class Conflict(APIException): + status_code = status.HTTP_409_CONFLICT + default_detail = _('Conflict request.') + default_code = 'conflict_error' + class MethodNotAllowed(APIException): status_code = status.HTTP_405_METHOD_NOT_ALLOWED default_detail = _('Method "{method}" not allowed.')