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

Develop to master #35

Merged
merged 28 commits into from
Nov 1, 2021
Merged

Develop to master #35

merged 28 commits into from
Nov 1, 2021

Conversation

ThrawnCA
Copy link

  • Synchronise history with upstream.
  • Expand usage of 'six' compatibility module.

amercader and others added 28 commits July 30, 2020 10:33
The way c.user is autopopulated on the context has changed on 2.9 so
these calls started returning a NotAuthorized error:

  File "/home/adria/dev/pyenvs/ckan/src/ckanext-xloader/ckanext/xloader/jobs.py", line 75, in xloader_data_into_datastore
    xloader_data_into_datastore_(input, job_dict)
  File "/home/adria/dev/pyenvs/ckan/src/ckanext-xloader/ckanext/xloader/jobs.py", line 140, in xloader_data_into_datastore_
    resource, dataset = get_resource_and_dataset(resource_id)
  File "/home/adria/dev/pyenvs/ckan/src/ckanext-xloader/ckanext/xloader/jobs.py", line 494, in get_resource_and_dataset
    res_dict = get_action('resource_show')(None, {'id': resource_id})
  File "/home/adria/dev/pyenvs/ckan/src/ckan/ckan/logic/__init__.py", line 475, in wrapped
    result = _action(context, data_dict, **kw)
  File "/home/adria/dev/pyenvs/ckan/src/ckan/ckan/logic/action/get.py", line 1085, in resource_show
    _check_access('resource_show', resource_context, data_dict)
  File "/home/adria/dev/pyenvs/ckan/src/ckan/ckan/logic/__init__.py", line 315, in check_access
    raise NotAuthorized(msg)
NotAuthorized: User None not authorized to read resource 0447ef5f-014b-436d-b9e9-e29f0b308c40

Pass ignore_auth=True explicitly to avoid having to call the auth functions.
This solves the exact same issue as the one described here for
DataPusher:

ckan/ckan#5173

Tl;DR: starting a transaction within another one in the `notify` method
led to the following error on CKAN 2.9:

  File "/home/adria/dev/pyenvs/ckan/src/ckan/ckan/views/resource.py",
  line 248, in post
      get_action(u'resource_create')(context, data)
        File
        "/home/adria/dev/pyenvs/ckan/src/ckan/ckan/logic/__init__.py",
        line 475, in wrapped
            result = _action(context, data_dict, **kw)
      File
      "/home/adria/dev/pyenvs/ckan/src/ckan/ckan/logic/action/create.py",
      line 332, in resource_create
          model.repo.commit()
      File
      "/home/adria/dev/pyenvs/ckan/lib/python2.7/site-packages/sqlalchemy/orm/scoping.py",
      line 162, in do
          return getattr(self.registry(), name)(*args, **kwargs)
      File
      "/home/adria/dev/pyenvs/ckan/lib/python2.7/site-packages/sqlalchemy/orm/session.py",
      line 1027, in commit
          self.transaction.commit()
      File
      "/home/adria/dev/pyenvs/ckan/lib/python2.7/site-packages/sqlalchemy/orm/session.py",
      line 494, in commit
          self._prepare_impl()
      File
      "/home/adria/dev/pyenvs/ckan/lib/python2.7/site-packages/sqlalchemy/orm/session.py",
      line 464, in _prepare_impl
          stx = self.session.transaction
          AttributeError: 'NoneType' object has no attribute
          'transaction'
Add ssl_verify option to callback_xloader_hook
Stream request needs to be explicited closed
Bring 2.9-fixes branch up to date with master
@ThrawnCA ThrawnCA requested review from asifaminb and duttonw October 31, 2021 23:42
@ThrawnCA ThrawnCA merged commit 450c8ab into master Nov 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants