plone / plone.restapi

RESTful API for Plone.
http://plonerestapi.readthedocs.org/
84 stars 76 forks source link

Remove long deprecated way of resolving Plone settings #1363

Open jensens opened 2 years ago

jensens commented 2 years ago

44 errors here are preventing the merge of https://github.com/plone/Products.CMFPlone/pull/3494 https://jenkins.plone.org/job/pull-request-6.0-3.7/1164/#showFailuresLink

All because it uses the long (since Plone 5.0!) deprecated way of using an adapter on the site root (instead of using the registry).

Example: https://github.com/plone/plone.restapi/blob/master/src/plone/restapi/tests/test_services_users.py#L136

security_settings = getAdapter(self.portal, ISecuritySchema)

Since plone.restapi can use plone.api in the tests, I propose to replace this with i.e.

from plone import api
security_settings = api.portal.get_registry_record(interface=ISecuritySchema)
jensens commented 2 years ago

This is still an issue!