Skip to content

Commit

Permalink
fix: extend geocat format mapping for format without underscore
Browse files Browse the repository at this point in the history
  • Loading branch information
sarusarah committed Oct 11, 2023
1 parent 0a33f12 commit a6badf1
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions ckanext/geocat/utils/ogdch_map_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,12 +270,13 @@ def map_service(geocat_service, issued, modified, description, rights):


def _map_geocat_resource_format_to_valid_format(geocat_format):
geocat_format_without_underscore = geocat_format.replace('_', '')
valid_formats = mu.get_format_values()
for key, value in valid_formats.items():
if geocat_format == key:
if geocat_format == key or geocat_format_without_underscore == key:
return value
valid_media_types = mu.get_iana_media_type_values()
for key, value in valid_media_types.items():
if geocat_format == key:
if geocat_format == key or geocat_format_without_underscore == key:
return value
return geocat_format

0 comments on commit a6badf1

Please sign in to comment.