Remove returning stored site user - #311
Conversation
… during package_create
|
To fix the build add the following lines to |
|
@Zharktas what do you mean with "site user is lost"? Lost how? The method only returns the username and not a user object, and the username won't change. Or am I missing something? |
|
If the site user has been previously fetched, https://github.com/vrk-kpa/ckanext-harvest/blob/f5df983542781b69728e1f871f4e7fd5baa86bea/ckanext/harvest/harvesters/base.py#L192 this never executes as the. And as the validatation error happens here https://github.com/vrk-kpa/ckanext-harvest/blob/f5df983542781b69728e1f871f4e7fd5baa86bea/ckanext/harvest/harvesters/base.py#L356, the SQLalchemy detaches itself. |
|
Okay just to get it right, if the user has been previously fetched (i.e. self._site_user = p.toolkit.get_action('get_site_user')(context, {})So far, everything is clear. What I don't understand is: why is it a problem if that line is not executed? Do we need I don't think, that it's a good idea to call |
|
I'll test tomorrow if reorganizing the code will help the issue. Either validate the dataset before any SQL magic happens or catch validation errors properly. |
|
Closed in favor of #312 |
Site user is lost when validation fail during package_create.
This might fix #151.