[#84] Fix auth audit exception when creating datasets
This was caused by a combination of the auth audit leaking and the harvester reusing the context for the package_show and package_create actions. If the package is not found, package_show does not call check_access, and the auth audit does not pass. This is stored in the context (`__auth_audit`) and is raised next time that we call get_action (when we call package_create with the same context) It could potentially be fixed on master, but it is probably quite rare.
This commit is contained in:
parent
5b677b6099
commit
2a07a144fc
|
@ -193,6 +193,10 @@ class HarvesterBase(SingletonPlugin):
|
||||||
except NotFound:
|
except NotFound:
|
||||||
# Package needs to be created
|
# Package needs to be created
|
||||||
|
|
||||||
|
# Get rid of auth audit on the context otherwise we'll get an
|
||||||
|
# exception
|
||||||
|
context.pop('__auth_audit', None)
|
||||||
|
|
||||||
# Set name if not already there
|
# Set name if not already there
|
||||||
package_dict.setdefault('name', self._gen_new_name(package_dict['title']))
|
package_dict.setdefault('name', self._gen_new_name(package_dict['title']))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue