OCHA-DAP / hdx-ckan

A repo for HDX's configurations and extensions to CKAN

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Organisation creation

kartikbha opened this issue · comments

Trying to create Organisation in the local latest HDX-CKAN instance. Request is getting placed but no org. is actually created in the system. SMTP settings are working as well. I am only getting a notification of a request submitted.
Can you please suggest, what to do to create organization in the local running instance of HDX-CKAN ?

configuration = Configuration(hdx_site='prod',hdx_key="xxxx-96bc4010740d",user_agent="admin",hdx_config_yaml="/root/hdx_configuration.yml",project_config_dict={"MY_PARAMETER":"MY_VALUE"})
remoteckan = ckanapi.RemoteCKAN("http://xxx:5050/",apikey="xxxxxx-96bc4010740d",user_agent="admin")
configuration.setup_remoteckan(remoteckan)

organization = Organization(configuration=configuration)
organization['field'] = 'ccc'
organization['name'] = 'ccc'
organization['title'] = 'ccc'
organization['description'] = 'cc'
organization['organization'] = 'cccc'
organization.create_in_hdx()

.create_in_hdx()
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/dist-packages/hdx/data/organization.py", line 117, in create_in_hdx
self._create_in_hdx('organization', 'id', 'name')
File "/usr/local/lib/python2.7/dist-packages/hdx/data/hdxobject.py", line 325, in _create_in_hdx
self._save_to_hdx('create', name_field_name, file_to_upload)
File "/usr/local/lib/python2.7/dist-packages/hdx/data/hdxobject.py", line 291, in _save_to_hdx
result = self._write_to_hdx(action, self.data, id_field_name, file_to_upload)
File "/usr/local/lib/python2.7/dist-packages/hdx/data/hdxobject.py", line 273, in _write_to_hdx
raisefrom(HDXError, 'Failed when trying to %s %s! (POST)' % (action, data[id_field_name]), e)
File "/usr/local/lib/python2.7/dist-packages/hdx/utilities/init.py", line 23, in raisefrom
six.reraise(exc_type, '%s - %s' % (message, exc), sys.exc_info()[2])
TypeError: str returned non-string (type dict)

Regards,
Kartik