#1465·eve

412 PRECONDITION FAILED when _etag is correct

Author: xibrizCreated Feb 8, 2022Updated Aug 17, 2023

Expected Behavior: 204 NO CONTENT

Actual Behavior: 412 PRECONDITION FAILED

If SOFT_DELETE is set to True on a global level and an endpoint is defined without a schema, it becomes impossible to delete.

Example endpoint:

my_endpoint = {
    'cache_control': 'no-store',
    'resource_methods': ['GET', 'POST'],
    'item_methods': ['DELETE'],
    'allow_unknown': True,
    'schema': {}
}

I found two work arounds:

  1. Add 'soft_delete': False to the configuration
  2. Set 'allow_unknown': False and define a schema

Either the response should be someting else becase the _etag is correct or the bug should be fixed.

Environment

  • Python version: 3.8.10
  • Eve version: 1.1.5