Skip to content

Commit

Permalink
Black 24.4.2 (#1787)
Browse files Browse the repository at this point in the history
* Upgrade Plone 6.0.7 to 6.0.11.1

* Add Plone 6.1

* Add changelog

* Pin Black==24.4.2

* Run black
  • Loading branch information
tisto authored May 16, 2024
1 parent 15ac486 commit f3d8216
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 19 deletions.
2 changes: 1 addition & 1 deletion constraints.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
black == 22.3.0
black == 24.4.2
flake8 == 4.0.1
1 change: 0 additions & 1 deletion plone-5.2.x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ extends =
base.cfg

[versions]
black = 22.3.0

# we need the newest plone.rest release
plone.rest = 3.0.1
Expand Down
1 change: 0 additions & 1 deletion plone-6.0.x.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions src/plone/restapi/services/locking/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
""" Locking
"""

from datetime import datetime
from datetime import timezone
from plone import api
Expand Down
4 changes: 1 addition & 3 deletions src/plone/restapi/services/relations/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
8 changes: 5 additions & 3 deletions src/plone/restapi/services/relations/delete.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down
6 changes: 3 additions & 3 deletions src/plone/restapi/services/types/get.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
Expand Down
6 changes: 3 additions & 3 deletions src/plone/restapi/tests/test_documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion src/plone/restapi/tests/test_services_contextnavigation.py
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ def testTopLevelWithNavigationRoot(self):
self.portal.folder2.folder21,
opts(
topLevel=1,
root_path="/folder2"
root_path="/folder2",
# self.portal.folder2.UID()
),
)
Expand Down
1 change: 1 addition & 0 deletions src/plone/restapi/types/adapters.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions src/plone/restapi/types/interfaces.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Interfaces."""

from zope.interface import Interface


Expand Down
8 changes: 5 additions & 3 deletions src/plone/restapi/types/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
}
Expand Down

0 comments on commit f3d8216

Please sign in to comment.