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

Fixing a bug related to custom user for harvesting jobs #226

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 7 additions & 5 deletions ckanext/harvest/harvesters/base.py
Expand Up @@ -170,15 +170,17 @@ def _get_user_name(self):
if self._user_name:
return self._user_name

config_user_name = config.get('ckanext.harvest.user_name')
if config_user_name:
self._user_name = config_user_name
return self._user_name

context = {'model': model,
'ignore_auth': True,
}

config_user_name = self.config.get('user')
if config_user_name:
user = p.toolkit.get_action('user_show')(context,
{'id': config_user_name})
self._user_name = user['name']
return self._user_name

# Check if 'harvest' user exists and if is a sysadmin
try:
user_harvest = p.toolkit.get_action('user_show')(
Expand Down