Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Organisation creation #4785

Open
kartikbha opened this issue Apr 25, 2018 · 1 comment
Open

Organisation creation #4785

kartikbha opened this issue Apr 25, 2018 · 1 comment

Comments

@kartikbha
Copy link

kartikbha commented Apr 25, 2018

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 ?

@kartikbha
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant