From 0998ff31cb7e49c959a9e72ce7cc77f412e91014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Schl=C3=B6gl?= Date: Fri, 17 Jan 2025 13:19:51 +0100 Subject: [PATCH] fix: add missing slash in entities uris resolves #415 --- apis_ontology/serializers.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/apis_ontology/serializers.py b/apis_ontology/serializers.py index 3c5d2c1..ac4474d 100644 --- a/apis_ontology/serializers.py +++ b/apis_ontology/serializers.py @@ -49,6 +49,8 @@ def to_representation(self, instance): base_uri = getattr( settings, "APIS_BASE_URI", self.context["request"].build_absolute_uri("/") ) + if not base_uri.endswith("/"): + base_uri += "/" # Define namespaces crm = Namespace("http://www.cidoc-crm.org/cidoc-crm/") @@ -109,6 +111,8 @@ def to_representation(self, instance): base_uri = getattr( settings, "APIS_BASE_URI", self.context["request"].build_absolute_uri("/") ) + if not base_uri.endswith("/"): + base_uri += "/" # Define namespaces crm = Namespace("http://www.cidoc-crm.org/cidoc-crm/") @@ -218,6 +222,8 @@ def to_representation(self, instance): base_uri = getattr( settings, "APIS_BASE_URI", self.context["request"].build_absolute_uri("/") ) + if not base_uri.endswith("/"): + base_uri += "/" # Define namespaces crm = Namespace("http://www.cidoc-crm.org/cidoc-crm/")