Pass defer_commit in context on get_site_user calls

See ckan/ckan#1714. Until that is fixed properly, the `defer_commit`
flag avoids some `DetachedInstanceErrors` happening during the
harvesting.
This commit is contained in:
amercader 2014-05-13 15:30:34 +01:00
parent a17e40c83e
commit a2758a3b30
1 changed files with 5 additions and 1 deletions

View File

@ -655,7 +655,11 @@ class SpatialHarvester(HarvesterBase):
if self._user_name:
return self._user_name
self._site_user = p.toolkit.get_action('get_site_user')({'model': model, 'ignore_auth': True}, {})
context = {'model': model,
'ignore_auth': True,
'defer_commit': True, # See ckan/ckan#1714
}
self._site_user = p.toolkit.get_action('get_site_user')(context, {})
config_user_name = config.get('ckanext.spatial.harvest.user_name')
if config_user_name: