Skip to content

Commit

Permalink
Merge branch 'master' into gdprcookie
Browse files Browse the repository at this point in the history
  • Loading branch information
cekk authored Apr 10, 2024
2 parents 845fe10 + d55121a commit 25e1774
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ Changelog
5.4.9 (unreleased)
------------------

- Limit event occurrences to 100.
[mamico]
- Customize INameChooser adapter to check also alias ids and disallow to create contents that could override aliases.
[cekk]
- Add flag in controlpanel to enable/disable INameChooser customization.
[cekk]
- Exclude bg_color from transformed fields in deserializer.
[cekk]
- Uninstall collective.volto.cookieconsent (deprecated). Will be removed from dependencies in next releases.
[cekk]
- Add dependency to collective.volto.gdprcookie and install it by default.
Expand Down
12 changes: 12 additions & 0 deletions src/redturtle/volto/monkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,13 @@
from zope.globalrequest import getRequest

import datetime
import logging
import os


logger = logging.getLogger(__name__)


def occurrences(self, range_start=None, range_end=None):
"""Return all occurrences of an event, possibly within a start and end
limit.
Expand Down Expand Up @@ -94,7 +98,15 @@ def get_obj(start):
id=str(start.date()), start=start, end=start + duration
).__of__(self.context)

limit = 100
for start in starts:
if limit < 0:
logger.warning(
"Too many occurrences for %s, stopping at 100",
self.context.absolute_url(),
)
raise StopIteration
limit -= 1
yield get_obj(start)


Expand Down
10 changes: 8 additions & 2 deletions src/redturtle/volto/restapi/deserializer/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,14 @@
from zope.interface import implementer


EXCLUDE_KEYS = ["@type", "token", "value", "@id", "query"]
EXCLUDE_TYPES = ["title", "listing", "calendar", "searchEvents", "form"]
EXCLUDE_KEYS = ["@type", "token", "value", "@id", "query", "bg_color"]
EXCLUDE_TYPES = [
"title",
"listing",
"calendar",
"searchEvents",
"form",
]


class GenericResolveUIDDeserializer(object):
Expand Down
10 changes: 8 additions & 2 deletions src/redturtle/volto/restapi/serializer/blocks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,14 @@
from zope.interface import implementer


EXCLUDE_KEYS = ["@type"]
EXCLUDE_TYPES = ["title", "listing", "form"]
EXCLUDE_KEYS = ["@type", "token", "value", "@id", "query", "bg_color"]
EXCLUDE_TYPES = [
"title",
"listing",
"calendar",
"searchEvents",
"form",
]


class GenericResolveUIDSerializer(object):
Expand Down

0 comments on commit 25e1774

Please sign in to comment.