Skip to content

Commit

Permalink
fix: add missing helper
Browse files Browse the repository at this point in the history
Must have accidentally deleted this whilst committing stuff :(
  • Loading branch information
jrdh committed Sep 17, 2024
1 parent 3d4fc42 commit f73541f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ckanext/nhm/lib/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -1606,3 +1606,15 @@ def get_record_iiif_manifest_url(resource_id: str, record_id: int) -> str:
{'builder_id': 'record', 'resource_id': resource_id, 'record_id': record_id},
)
return toolkit.url_for('iiif.resource', identifier=manifest_id, _external=True)


def get_sample_voucher_guid(associated_occurrence_value: str) -> str:
"""
Given an associatedOccurrence value from a Sample record, returns the associated
specimen GUID.
:param associated_occurrence_value: the associatedOccurrence value
:return: the voucher specimen GUID
"""
_, guid = associated_occurrence_value.split(":", 1)
return guid

0 comments on commit f73541f

Please sign in to comment.