-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validate that every relation has a relation type #333
Comments
requesting the webpage of the entities of this relation also result in 500: https://ica.acdh-dev.oeaw.ac.at/apis/entities/entity/person/540/detail |
tested it inlocal instance, its possible to create a relation without a relationtype. Shouldnt be and actually wasnt the case. we need fix that. |
note that this currently also crashes the UI, e.g. https://ica.acdh-dev.oeaw.ac.at/apis/entities/entity/person/540/detail looking at the response from https://ica.acdh-dev.oeaw.ac.at/apis/api/entities/person/540/ there's a empty relation type |
@steffres are you working on this? |
Sorry, I'll try to get to it. |
Sentry issue: APIS-PMB-M |
seems to be linked to sentry issue #APIS-PMB-M and issue #325 |
I've added a check to relation class if any foreign keys are null. This check happens on save call and not on the field definition itself as it might be necessary to temporarily allow None values in memory. However this does not fix the currently missing As for issue #325 I can query succesfully https://pmb.acdh.oeaw.ac.at/apis/api/relations/placeevent/?format=json%2Bnet&limit=51%22 though I don't understand how these issues are supposed to be connected. relevant commit: |
just fyi, |
True. When I had curled it I forgot quotation marks and the @gregorpirgie how do you think this issue is related to #325 ? In that sentry https://sentry.acdh-dev.oeaw.ac.at/organizations/acdhch-sentry/issues/142/?project=3 I don't see anything that points to a empty |
As discussed in JF and investigated by Gregor, this looks like it's caused by the json serializer (https://github.com/acdh-oeaw/apis-core/blob/master/apis_core/api_renderers.py). Matthias will look into this. |
ok, so I reproduced the error locally. And it is caused by |
please note (@stefanprobst ) that this fix leaves out the broken entries from the db. so `curl "https://pmb.acdh.oeaw.ac.at/apis/api/relations/placeevent/?format=json%2Bnet&limit=51" wont break the API anymore, but until the broken entry is fixed return only 50 entries instead of 51 |
btw @steffres , as @gregorpirgie pointed me to it. Is there a special reason you added the check function rather than setting the |
the fix mentioned above is deployed on our instances |
can you quickly clarify what has been fixed, and what has not yet?
EDIT: i guess this is mostly about validation on-save, not the response data? |
yes, validation is now in place, but there is still invalid data |
not sure if this has already been fixed, but the ICA instance has relationships without a relation type. i think saving these should be disallowed.
example:
https://ica.acdh-dev.oeaw.ac.at/apis/api/relations/personplace/542/
results in:
other example relations with the same issue: 532, 535, 538,
note that all of these have
published: false
The text was updated successfully, but these errors were encountered: