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

Performance improvements #188

Merged
merged 4 commits into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
exclude: "^$|src/recensio/plone/browser/bundles"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/asottile/pyupgrade
rev: v3.4.0
rev: v3.19.1
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/psf/black
rev: 23.3.0
rev: 24.10.0
hooks:
- id: black
- repo: https://github.com/PyCQA/isort
rev: 5.12.0
rev: 5.13.2
hooks:
- id: isort
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
rev: 7.1.1
hooks:
- id: flake8
- repo: https://github.com/PyCQA/bandit
Expand All @@ -33,7 +33,7 @@ repos:
- --confidence-level=medium
- --skip=B608
- repo: https://github.com/collective/zpretty
rev: 3.1.0a2
rev: 3.1.0
hooks:
- id: zpretty
# - repo: https://github.com/PyCQA/docformatter
Expand Down
4 changes: 3 additions & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ Changelog
1.0.4 (unreleased)
------------------

- Nothing changed yet.
- Performance improvements
`#3067 <https://github.com/syslabcom/scrum/issues/3067>`_
[ale-rt]


1.0.3 (2024-07-30)
Expand Down
2 changes: 1 addition & 1 deletion buildout.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ auto-checkout =


[test]
recipe = collective.xmltestreport
recipe = zc.recipe.testrunner
defaults = ['--auto-color', '--auto-progress', '-s', 'recensio.plone']
eggs =
Products.CMFPlone
Expand Down
1 change: 1 addition & 0 deletions src/recensio/plone/mails/legacy.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Contains code migrated from the old recensio packages."""

from plone import api
from Products.Five import BrowserView
from recensio.plone import _
Expand Down
8 changes: 6 additions & 2 deletions src/recensio/plone/migration/import_pagePictures.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,19 @@ def handleApply(self, action):
)
with blob_path.open("rb") as f:
pagePictures.append(
NamedBlobImage(data=f.read(), filename=f"{blob_idx+1}.gif")
NamedBlobImage(
data=f.read(), filename=f"{blob_idx + 1}.gif"
)
)
elif isinstance(blob_path, str):
# Looks like, when export_page_pictures was called TTW, the
# whole blob path was stored as string. No need to use
# COLLECTIVE_EXPORTIMPORT_BLOB_HOME in that case.
with open(blob_path, "rb") as f:
pagePictures.append(
NamedBlobImage(data=f.read(), filename=f"{blob_idx+1}.gif")
NamedBlobImage(
data=f.read(), filename=f"{blob_idx + 1}.gif"
)
)

obj.pagePictures = pagePictures
Expand Down
8 changes: 3 additions & 5 deletions src/recensio/plone/viewlets/viewlets.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,9 @@ def _get_toggle_link(self, uid):

def _get_css_classes(self, obj):
css_classes = []
reviews = [
obj
for obj in obj.objectValues()
if obj.portal_type in ("Review Monograph", "Review Journal")
]
reviews = api.content.find(
context=obj, portal_type=["Review Monograph", "Review Journal"], depth=1
)
if len(reviews) > 0:
css_classes.append("review_container")
if self.is_expanded(obj.UID()):
Expand Down
Loading