From 90e77ae13f2e9a4001eefbaa809abc8eed80c56f Mon Sep 17 00:00:00 2001
From: Thorge Petersen <petersen@rz.uni-kiel.de>
Date: Tue, 28 Jun 2022 14:36:52 +0200
Subject: [PATCH] Fixed field (extras instead of dataset)

---
 ckanext/odsh/profiles/odsh_dcat_de_profile.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/ckanext/odsh/profiles/odsh_dcat_de_profile.py b/ckanext/odsh/profiles/odsh_dcat_de_profile.py
index 3176fe37..08dc6902 100644
--- a/ckanext/odsh/profiles/odsh_dcat_de_profile.py
+++ b/ckanext/odsh/profiles/odsh_dcat_de_profile.py
@@ -8,6 +8,7 @@ from ckanext.dcat.utils import resource_uri
 import ckanext.dcatde.dataset_utils as ds_utils
 from ckanext.dcatde.profiles import DCATdeProfile, DCATDE, DCAT, DCATDE_1_0, DCATDE_1_0_1, DCATDE_1_0_2
 
+import ckanext.odsh.helpers as odsh_helpers
 import ckanext.odsh.helpers_tpsh as helpers_tpsh
 import ckanext.odsh.collection.helpers as helpers_collection
 
@@ -106,7 +107,7 @@ class ODSHDCATdeProfile(DCATdeProfile):
         Adds reference (Musterdatenkatalog/Musterdatensatz) extra field to
         dcat:references.
         '''
-        sample_dataset_uri = resource_dict.get('sample_dataset', None)
+        sample_dataset_uri = odsh_helpers.odsh_extract_value_from_extras(dataset_dict.get('extras'), 'reference')
         if sample_dataset_uri:
             self.g.set(
                 (dataset_ref, DCT.references,
-- 
GitLab