Skip to content

Commit

Permalink
Merge pull request #30 from datagovau/v2.10.3
Browse files Browse the repository at this point in the history
V2.10.3
  • Loading branch information
ChrisThompsonAbs authored Dec 15, 2023
2 parents 0954e7c + 6341d2e commit 31211ae
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
###############################################################################
# requirements: start #
###############################################################################
ckan_tag = ckan-2.10.1
ckan_tag = ckan-2.10.3
ext_list = dcat officedocs pdfview zippreview spatial cesiumpreview harvest agls xloader flakes googleanalytics charts


Expand Down
15 changes: 15 additions & 0 deletions ckanext/datagovau/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import inspect
import logging
import json

import ckan.authz as authz
import ckan.lib.helpers as h
Expand Down Expand Up @@ -77,6 +78,20 @@ def update_config(self, config):

def before_dataset_index(self, pkg_dict):
pkg_dict["unpublished"] = tk.asbool(pkg_dict.get("unpublished"))

# uploading resources to datastore will cause SOLR error
# for multivalued field
# inside set_datastore_active_flag action before
# reindexing the dataset, it retrieves the data from package_show
# therefore these two fields are not converted.
geospatial_topic = pkg_dict["geospatial_topic"]
if geospatial_topic and not isinstance(geospatial_topic, str):
pkg_dict["geospatial_topic"] = json.dumps(geospatial_topic)

field_of_research = pkg_dict['field_of_research']
if field_of_research and not isinstance(field_of_research, str):
pkg_dict['field_of_research'] = json.dumps(field_of_research)

return pkg_dict

def before_dataset_search(self, search_params):
Expand Down

0 comments on commit 31211ae

Please sign in to comment.