Internal Server Error 500 after two consecutive PATCH requests
While adding data to the draft, the first PATCH request successfully adds data to the existing draft. But if the same request is made with the identical payload/data (e.g. [email protected]) for the same path (e.g. contact_email), Internal Server Error (500) will be returned from the API.
data_patch = [
{"op": "add", "path": "/contact_email", "value": "[email protected]"},
]
This seems to be happening because publication state disappears in https://github.com/EUDAT-B2SHARE/b2share/blob/8834415ae5619fe661bd8bab47383b49c82f691c/b2share/modules/deposit/permissions.py#L323
Could it be that whole block in this part is indented one level less than it should be?
@JohannesLares @hjhsalo
The indent theory has been briefly tested and it seems that fixing indentation fixes the problem. Full unit test suite was not yet run. @gcakir do you want to open a pull request?
The indent theory has been briefly tested and it seems that fixing indentation fixes the problem. Full unit test suite was not yet run. @gcakir do you want to open a pull request?
Pull request created. :+1: