plone.api 2.4.0__tar.gz → 2.4.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {plone_api-2.4.0 → plone_api-2.4.1}/CHANGES.md +7 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/PKG-INFO +8 -1
- {plone_api-2.4.0 → plone_api-2.4.1}/setup.py +1 -1
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/content.py +17 -2
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone.api.egg-info/PKG-INFO +8 -1
- {plone_api-2.4.0 → plone_api-2.4.1}/CONTRIBUTING.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/LICENSE +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/MANIFEST.in +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/README.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/docs/about.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/docs/content.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/docs/contribute.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/docs/env.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/docs/group.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/docs/index.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/docs/portal.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/docs/relation.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/docs/user.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/pyproject.toml +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/setup.cfg +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/__init__.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/__init__.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/configure.zcml +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/env.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/exc.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/group.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/portal.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/profiles/testfixture/metadata.xml +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/profiles/testfixture/types/Dexterity_Folder.xml +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/profiles/testfixture/types/Dexterity_Item.xml +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/profiles/testfixture/types.xml +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/relation.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/testing.zcml +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/Dexterity_Folder.xml +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/Dexterity_Item.xml +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/__init__.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/base.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/doctests/about.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/doctests/content.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/doctests/contribute.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/doctests/env.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/doctests/group.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/doctests/portal.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/doctests/relation.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/doctests/user.md +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/test_content.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/test_doctests.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/test_env.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/test_group.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/test_portal.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/test_relation.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/test_user.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/tests/test_validation.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/user.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/validation.py +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone.api.egg-info/SOURCES.txt +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone.api.egg-info/dependency_links.txt +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone.api.egg-info/namespace_packages.txt +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone.api.egg-info/not-zip-safe +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone.api.egg-info/requires.txt +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/src/plone.api.egg-info/top_level.txt +0 -0
- {plone_api-2.4.0 → plone_api-2.4.1}/tox.ini +0 -0
|
@@ -9,6 +9,13 @@
|
|
|
9
9
|
|
|
10
10
|
<!-- towncrier release notes start -->
|
|
11
11
|
|
|
12
|
+
## 2.4.1 (2025-03-17)
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Bug fixes:
|
|
16
|
+
|
|
17
|
+
- Attempt to generate a random temporary id for a content type up to 100 times, else continue to raise a `zExceptions.BadRequest` error. @rohnsha0 #445
|
|
18
|
+
|
|
12
19
|
## 2.4.0 (2025-03-14)
|
|
13
20
|
|
|
14
21
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: plone.api
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.1
|
|
4
4
|
Summary: A Plone API.
|
|
5
5
|
Home-page: https://github.com/plone/plone.api
|
|
6
6
|
Author: Plone Foundation
|
|
@@ -127,6 +127,13 @@ Continuous Integration
|
|
|
127
127
|
|
|
128
128
|
<!-- towncrier release notes start -->
|
|
129
129
|
|
|
130
|
+
## 2.4.1 (2025-03-17)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
### Bug fixes:
|
|
134
|
+
|
|
135
|
+
- Attempt to generate a random temporary id for a content type up to 100 times, else continue to raise a `zExceptions.BadRequest` error. @rohnsha0 #445
|
|
136
|
+
|
|
130
137
|
## 2.4.0 (2025-03-14)
|
|
131
138
|
|
|
132
139
|
|
|
@@ -22,12 +22,15 @@ from zope.globalrequest import getRequest
|
|
|
22
22
|
from zope.interface import Interface
|
|
23
23
|
from zope.interface import providedBy
|
|
24
24
|
|
|
25
|
-
import random
|
|
26
25
|
import transaction
|
|
26
|
+
import uuid
|
|
27
27
|
|
|
28
28
|
|
|
29
29
|
_marker = []
|
|
30
30
|
|
|
31
|
+
# Maximum number of attempts to generate a unique random ID
|
|
32
|
+
MAX_UNIQUE_ID_ATTEMPTS = 100
|
|
33
|
+
|
|
31
34
|
|
|
32
35
|
@required_parameters("container", "type")
|
|
33
36
|
@at_least_one_of("id", "title")
|
|
@@ -67,7 +70,19 @@ def create(
|
|
|
67
70
|
:Example: :ref:`content-create-example`
|
|
68
71
|
"""
|
|
69
72
|
# Create a temporary id if the id is not given
|
|
70
|
-
|
|
73
|
+
if not safe_id and id:
|
|
74
|
+
content_id = id
|
|
75
|
+
else:
|
|
76
|
+
# Try to generate a unique random ID using UUID4
|
|
77
|
+
attempts = 0
|
|
78
|
+
while attempts < MAX_UNIQUE_ID_ATTEMPTS:
|
|
79
|
+
content_id = str(uuid.uuid4())
|
|
80
|
+
if content_id not in container:
|
|
81
|
+
break
|
|
82
|
+
attempts += 1
|
|
83
|
+
# If we couldn't find a unique ID after max attempts, raise ValueError
|
|
84
|
+
if attempts >= MAX_UNIQUE_ID_ATTEMPTS:
|
|
85
|
+
raise ValueError("Could not find unique id while creating content.")
|
|
71
86
|
|
|
72
87
|
if title:
|
|
73
88
|
kwargs["title"] = title
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.2
|
|
2
2
|
Name: plone.api
|
|
3
|
-
Version: 2.4.
|
|
3
|
+
Version: 2.4.1
|
|
4
4
|
Summary: A Plone API.
|
|
5
5
|
Home-page: https://github.com/plone/plone.api
|
|
6
6
|
Author: Plone Foundation
|
|
@@ -127,6 +127,13 @@ Continuous Integration
|
|
|
127
127
|
|
|
128
128
|
<!-- towncrier release notes start -->
|
|
129
129
|
|
|
130
|
+
## 2.4.1 (2025-03-17)
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
### Bug fixes:
|
|
134
|
+
|
|
135
|
+
- Attempt to generate a random temporary id for a content type up to 100 times, else continue to raise a `zExceptions.BadRequest` error. @rohnsha0 #445
|
|
136
|
+
|
|
130
137
|
## 2.4.0 (2025-03-14)
|
|
131
138
|
|
|
132
139
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/profiles/testfixture/types/Dexterity_Folder.xml
RENAMED
|
File without changes
|
{plone_api-2.4.0 → plone_api-2.4.1}/src/plone/api/profiles/testfixture/types/Dexterity_Item.xml
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|