diff --git a/constraints.txt b/constraints.txt index f2204a07f9..c69b2f01b3 100644 --- a/constraints.txt +++ b/constraints.txt @@ -1,2 +1,2 @@ -black == 22.3.0 +black == 24.4.2 flake8 == 4.0.1 \ No newline at end of file diff --git a/plone-5.2.x.cfg b/plone-5.2.x.cfg index d2924baf42..4840fc7756 100644 --- a/plone-5.2.x.cfg +++ b/plone-5.2.x.cfg @@ -4,7 +4,6 @@ extends = base.cfg [versions] -black = 22.3.0 # we need the newest plone.rest release plone.rest = 3.0.1 diff --git a/plone-6.0.x.cfg b/plone-6.0.x.cfg index b3f43581f3..5c418ddfe0 100644 --- a/plone-6.0.x.cfg +++ b/plone-6.0.x.cfg @@ -13,7 +13,6 @@ recipe = plone.recipe.zope2instance zodb-temporary-storage = off [versions] -black = 22.3.0 pygments = 2.14.0 plone.app.linkintegrity = 4.0.3 robotframework-browser = 17.5.2 diff --git a/src/plone/restapi/services/locking/__init__.py b/src/plone/restapi/services/locking/__init__.py index 53fce1b03d..1b22e975a6 100644 --- a/src/plone/restapi/services/locking/__init__.py +++ b/src/plone/restapi/services/locking/__init__.py @@ -1,5 +1,6 @@ """ Locking """ + from datetime import datetime from datetime import timezone from plone import api diff --git a/src/plone/restapi/services/relations/add.py b/src/plone/restapi/services/relations/add.py index de9b186561..2bcc1cee95 100644 --- a/src/plone/restapi/services/relations/add.py +++ b/src/plone/restapi/services/relations/add.py @@ -93,9 +93,7 @@ def reply(self): msg = ( "Source and target not found." if not source_obj and not target_obj - else "Source not found." - if not source_obj - else "Target not found." + else "Source not found." if not source_obj else "Target not found." ) msg = f"Failed on creating a relation. {msg}" log.error(f"{msg} {relationdata}") diff --git a/src/plone/restapi/services/relations/delete.py b/src/plone/restapi/services/relations/delete.py index 5d8f691191..cb4d56a6e5 100644 --- a/src/plone/restapi/services/relations/delete.py +++ b/src/plone/restapi/services/relations/delete.py @@ -40,9 +40,11 @@ def reply(self): msg = ( "Source and target not found." if not source_obj and not target_obj - else "Source not found." - if not source_obj - else "Target not found." + else ( + "Source not found." + if not source_obj + else "Target not found." + ) ) msg = f"Failed on deleting a relation. {msg}" log.error(f"{msg} {relationdata}") diff --git a/src/plone/restapi/services/types/get.py b/src/plone/restapi/services/types/get.py index 536dbd4495..af20cdd01f 100644 --- a/src/plone/restapi/services/types/get.py +++ b/src/plone/restapi/services/types/get.py @@ -76,9 +76,9 @@ def __call__(self, expand=False): "id": fti.getId(), "title": translate(fti.Title(), context=self.request), "addable": fti.getId() in allowed_types if can_add else False, - "immediately_addable": fti.getId() in immediately_types - if can_add - else False, + "immediately_addable": ( + fti.getId() in immediately_types if can_add else False + ), } for fti in ftis ] diff --git a/src/plone/restapi/tests/test_documentation.py b/src/plone/restapi/tests/test_documentation.py index 9c0fc9d342..c25b896ef8 100644 --- a/src/plone/restapi/tests/test_documentation.py +++ b/src/plone/restapi/tests/test_documentation.py @@ -1710,9 +1710,9 @@ def test_update_with_lock(self): headers={"Lock-Token": token}, json={"title": "New Title"}, ) - response.request.headers[ - "Lock-Token" - ] = "0.684672730996-0.25195226375-00105A989226:1477076400.000" # noqa + response.request.headers["Lock-Token"] = ( + "0.684672730996-0.25195226375-00105A989226:1477076400.000" # noqa + ) save_request_and_response_for_docs("lock_update", response) def test_querystring_get(self): diff --git a/src/plone/restapi/tests/test_services_contextnavigation.py b/src/plone/restapi/tests/test_services_contextnavigation.py index 3e2f8daf43..9f8405e95a 100644 --- a/src/plone/restapi/tests/test_services_contextnavigation.py +++ b/src/plone/restapi/tests/test_services_contextnavigation.py @@ -597,7 +597,7 @@ def testTopLevelWithNavigationRoot(self): self.portal.folder2.folder21, opts( topLevel=1, - root_path="/folder2" + root_path="/folder2", # self.portal.folder2.UID() ), ) diff --git a/src/plone/restapi/types/adapters.py b/src/plone/restapi/types/adapters.py index 2998ca7de5..d7ceb2091d 100644 --- a/src/plone/restapi/types/adapters.py +++ b/src/plone/restapi/types/adapters.py @@ -1,4 +1,5 @@ """JsonSchema providers.""" + from plone.app.textfield.interfaces import IRichText from plone.restapi.types.interfaces import IJsonSchemaProvider from plone.restapi.types.utils import get_fieldsets diff --git a/src/plone/restapi/types/interfaces.py b/src/plone/restapi/types/interfaces.py index f1584bfa2d..90ac377013 100644 --- a/src/plone/restapi/types/interfaces.py +++ b/src/plone/restapi/types/interfaces.py @@ -1,4 +1,5 @@ """Interfaces.""" + from zope.interface import Interface diff --git a/src/plone/restapi/types/utils.py b/src/plone/restapi/types/utils.py index b3f78c991f..e146f9b992 100644 --- a/src/plone/restapi/types/utils.py +++ b/src/plone/restapi/types/utils.py @@ -115,9 +115,11 @@ def get_form_fieldsets(form): fieldset = { "id": group.__name__, "title": translate(group.label, context=getRequest()), - "description": translate(group.description, context=getRequest()) - if group.description is not None - else "", + "description": ( + translate(group.description, context=getRequest()) + if group.description is not None + else "" + ), "fields": list(group.fields.values()), "behavior": "plone", }