Skip to content

Commit

Permalink
feat: Move permalink construction into a helper function
Browse files Browse the repository at this point in the history
  • Loading branch information
bellisk committed Nov 2, 2023
1 parent 4e26067 commit b68aea6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ckanext/dcatapchharvest/dcat_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,16 @@ def dataset_uri(dataset_dict, dataset_ref=None):
uri = ''
break
if not uri:
site_url = config.get('ckan.site_url')
uri = u'{0}/perma/{1}'.format(site_url,
dataset_dict.get('identifier'))
uri = get_permalink(dataset_dict.get('identifier'))

return uri


def get_permalink(identifier):
site_url = config.get('ckan.site_url')
return u'{0}/perma/{1}'.format(site_url, identifier)


def resource_uri(resource_dict, distribution=None):
"""
Returns a URI for the resource
Expand Down

0 comments on commit b68aea6

Please sign in to comment.