mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-29 01:20:02 +03:00
Add PreconditionFailed exception
This commit is contained in:
parent
ebb47bb38f
commit
53ca0c02b0
|
@ -88,6 +88,14 @@ class Throttled(APIException):
|
|||
self.detail = detail or self.default_detail
|
||||
|
||||
|
||||
class PreconditionFailed(APIException):
|
||||
status_code = status.HTTP_412_PRECONDITION_FAILED
|
||||
default_detail = 'Object has been updated since you retrieved it.'
|
||||
|
||||
def __init__(self, detail=None):
|
||||
self.detail = detail or self.default_detail
|
||||
|
||||
|
||||
class ConfigurationError(Exception):
|
||||
"""
|
||||
Indicates an internal server error.
|
||||
|
|
Loading…
Reference in New Issue
Block a user