diff --git a/rest_framework/exceptions.py b/rest_framework/exceptions.py index 89dc88fe3..9ceb64fe1 100644 --- a/rest_framework/exceptions.py +++ b/rest_framework/exceptions.py @@ -96,14 +96,6 @@ class PreconditionFailed(APIException): self.detail = detail or self.default_detail -class IfMatchMissing(APIException): - default_detail = 'IF_MATCH header is required' - status_code = status.HTTP_400_BAD_REQUEST - - def __init__(self, detail=None): - self.detail = detail or self.default_detail - - class ConfigurationError(Exception): """ Indicates an internal server error. diff --git a/rest_framework/views.py b/rest_framework/views.py index 837d20912..59b15e998 100644 --- a/rest_framework/views.py +++ b/rest_framework/views.py @@ -313,15 +313,6 @@ class APIView(View): headers.update(cache_lookup.get_response_header(obj)) return headers - def check_update_validity(self, request): - """ - """ - # TODO add setting to cover - # * raise IfMatchMissing when it's missing (if it's there, carry on) - # * continue regardless - if request.META.get('HTTP_IF_MATCH') is None: - raise exceptions.IfMatchMissing - def cache_precondition_check(self, obj, request): for cache_lookup in self.get_cache_lookups(): cache_lookup.precondition_check(obj, request) @@ -430,10 +421,6 @@ class APIView(View): else: handler = self.http_method_not_allowed - if request.method.lower() in ('put', 'delete'): - # FIXME this method name isn't obvious - self.check_update_validity(request) - response = handler(request, *args, **kwargs) except Exception as exc: