Initial import of zip file fails with missing tag vocabulary
Created by: lwm
So, I'm trying to get a reliable docker-compose managed map action setup over at https://github.com/aptivate/mapaction-docker and so far, things work. In order to load some test data, I need to create an organisation and event, and then run the zip import. The zip import fails with a message like:
The tag vocabulary "produce_themes" does not exist
So, with the following diff in mapactionimporter
, I'm able to run the import:
diff --git a/ckanext/mapactionimporter/controllers/zipimport.py b/ckanext/mapactionimporter/controllers/zipimport.py
index 83b76c7..7f809b3 100644
--- a/ckanext/mapactionimporter/controllers/zipimport.py
+++ b/ckanext/mapactionimporter/controllers/zipimport.py
@@ -27,6 +27,9 @@ class ZipImportController(toolkit.BaseController):
)
def import_dataset(self):
+ from ckanext.mapactionimporter.plugin import create_product_themes
+ create_product_themes()
+
context = {
'model': model,
'session': model.Session,
diff --git a/ckanext/mapactionimporter/plugin.py b/ckanext/mapactionimporter/plugin.py
index 119840e..3a17e8a 100644
--- a/ckanext/mapactionimporter/plugin.py
+++ b/ckanext/mapactionimporter/plugin.py
@@ -23,7 +23,7 @@ def register_translator():
registry.register(translator, translator_obj)
def create_product_themes():
- register_translator()
+ # register_translator()
user = toolkit.get_action('get_site_user')({'ignore_auth': True}, {})
context = {'user': user['name']}
Am I doing something wrong? Is there some way I can create these tags/vocabs without hacking the importer code, or the importer code should handle this case on initial import.