mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-18 04:02:35 +03:00
Update exceptions.py
I added a new exception class called Conflict to the Django REST framework. This exception is raised when a user's request conflicts with existing data in the system.
This commit is contained in:
parent
5a01a4c8a9
commit
f277956924
|
@ -203,6 +203,10 @@ 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
|
||||
|
|
Loading…
Reference in New Issue
Block a user