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:
parent
a17e40c83e
commit
a2758a3b30
|
@ -655,7 +655,11 @@ class SpatialHarvester(HarvesterBase):
|
||||||
if self._user_name:
|
if self._user_name:
|
||||||
return 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')
|
config_user_name = config.get('ckanext.spatial.harvest.user_name')
|
||||||
if config_user_name:
|
if config_user_name:
|
||||||
|
|
Loading…
Reference in New Issue