Commit 24eff471 authored by Denis Laxalde's avatar Denis Laxalde
Browse files

[entities] Handle cases where dataset maintainer is not a CWUser

parent c7556306b72d
...@@ -106,9 +106,12 @@ class CKANDatasetAdapter(EntityAdapter): ...@@ -106,9 +106,12 @@ class CKANDatasetAdapter(EntityAdapter):
} }
maintainer = self.dataset_maintainer() maintainer = self.dataset_maintainer()
if maintainer: if maintainer:
data['maintainer'] = maintainer.dc_long_title() if isinstance(maintainer, basestring):
if maintainer.primary_email: data['maintainer'] = maintainer
data['maintainer_email'] = maintainer.primary_email[0].address else:
data['maintainer'] = maintainer.dc_long_title()
if maintainer.primary_email:
data['maintainer_email'] = maintainer.primary_email[0].address
data['tags'] = list(self.dataset_tags()) data['tags'] = list(self.dataset_tags())
data['extras'] = list(self.dataset_extras()) data['extras'] = list(self.dataset_extras())
return data return data
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment