acdh-oeaw / apis-core

https://acdh-oeaw.github.io/apis-core/
MIT License
11 stars 3 forks source link

#361 detail and custom TEI views check in URIS if pk does not match #362

Closed csae8092 closed 1 year ago

csae8092 commented 1 year ago

https://pmb.acdh.oeaw.ac.at/apis/entities/entity/place/50/detail has e.g. apis-default uris

so calling e.g. https://pmb.acdh.oeaw.ac.at/apis/entities/entity/place/65223/detail returned a 404, with this pr

calling e.g. https://pmb.acdh.oeaw.ac.at/apis/entities/entity/place/65223/detail redirects now to https://pmb.acdh.oeaw.ac.at/apis/entities/entity/place/50/detail

the same logic is applied to custom TEI endpoints but without redirect https://pmb.acdh.oeaw.ac.at/apis/entities/tei/place/50 works (as always) https://pmb.acdh.oeaw.ac.at/apis/entities/tei/place/65223 (no works as well)

also the previous hard code "apis default" can now be changed in the settings file DOMAIN_DEFAULT = getattr(settings, "APIS_DEFAULT_DOMAIN", "apis default")