Thanks to visit codestin.com
Credit goes to github.com

Skip to content

422 UNPROCESSABLE ENTITY when using user_id and data_relation on PATCH #1472

@xibriz

Description

@xibriz

Expected Behavior: 200 OK

Actual Behavior: 422 UNPROCESSABLE ENTITY

If using set_request_auth_value on a schema and having defined a data_relation to a schema that is not using any auth value,
a PATCH operation will fail with the follwoing error:

value 'XXX' must exist in resource 'YYY', field '_id'

POST works fine.

The only workaround is not to define any data_relation.

According to my research, the _filter variable contains the user_id in an $and condition when PATCH but not on POST.

datasource, filter_, projection, _ = self._datasource_ex(

Environment

  • Python version: 3.8.10
  • Eve version: 1.1.5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions