Closed koenedaele closed 1 year ago
Probably somewhat related to #833
example payload to reproduce:
{
"id":"test",
"conceptscheme_uri":"urn:x-skosprovider:testid",
"uri_pattern":"https://id.erfgoed.net/thesauri/test/%s",
"subject":[
],
"id_generation_strategy":"NUMERIC",
"expand_strategy":"recurse",
"default_language":"",
"force_display_language":""
}
Issue seems to be frontend.
They perform a put instead of post when an ID is present. The post with id seems to work fine as demonstrated in the screen shot. The NoResultFound happens because you try to edit an unexisting provider. Also noticeable in the stack trace:
File "/home/koen/Projecten/python/skos/atramhasis/atramhasis/views/crud.py", line 313, in update_provider db_provider = provider.update_provider( File "/home/koen/Projecten/python/skos/atramhasis/atramhasis/json_processors/provider.py", line 36, in update_provider db_provider = manager.get_provider_by_id(provider_id)
In normal REST systems, a POST is without ID (telling the server to create an id itself). If you want to add something with a specific ID, a PUT is normally the correct method. Granted, we don't often allow the client to choose the ID so we might not often implement this. But normally:
I try to add a new provider. If I specify an ID (eg. METAL), the provider is not created. If a leave the ID field blank, one is created with a numeric id (identical to the conceptscheme id).
The server gives the following stack trace:
Looks like a backend issue, not frontend.