From d8958427ff7064b5774584f9dbc9e50875d23190 Mon Sep 17 00:00:00 2001 From: davisagli Date: Thu, 21 Sep 2023 14:15:10 -0700 Subject: [PATCH] [fc] Repository: plone.restapi Branch: refs/heads/main Date: 2023-09-21T14:15:10-07:00 Author: Timo Stollenwerk (tisto) Commit: https://github.com/plone/plone.restapi/commit/3e3f58a0a3780addf59a8862c957a0f15038b1a1 Undeprecate token param on vocabularies endpoint (#1708) Files changed: A news/1697.bugfix M src/plone/restapi/serializer/vocabularies.py --- last_commit.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/last_commit.txt b/last_commit.txt index 3ade669126..1e2b62a9fc 100644 --- a/last_commit.txt +++ b/last_commit.txt @@ -2,15 +2,15 @@ Repository: plone.restapi Branch: refs/heads/main -Date: 2023-09-21T14:11:39-07:00 +Date: 2023-09-21T14:15:10-07:00 Author: Timo Stollenwerk (tisto) -Commit: https://github.com/plone/plone.restapi/commit/863d9a20ce22e63843848a76ffcde5c139674be5 +Commit: https://github.com/plone/plone.restapi/commit/3e3f58a0a3780addf59a8862c957a0f15038b1a1 -Undeprecate comma-separated list of expansion (#1707) +Undeprecate token param on vocabularies endpoint (#1708) Files changed: -A news/1696.bugfix -M src/plone/restapi/serializer/expansion.py +A news/1697.bugfix +M src/plone/restapi/serializer/vocabularies.py -b'diff --git a/news/1696.bugfix b/news/1696.bugfix\nnew file mode 100644\nindex 000000000..39b4c8ade\n--- /dev/null\n+++ b/news/1696.bugfix\n@@ -0,0 +1 @@\n+Undeprecate comma separated expansion parameters (that were deprecated in plone.restapi 8) @tisto\n\\ No newline at end of file\ndiff --git a/src/plone/restapi/serializer/expansion.py b/src/plone/restapi/serializer/expansion.py\nindex b7d10fa30..6c0db6826 100644\n--- a/src/plone/restapi/serializer/expansion.py\n+++ b/src/plone/restapi/serializer/expansion.py\n@@ -1,19 +1,14 @@\n from plone.restapi.interfaces import IExpandableElement\n from zope.component import getAdapters\n \n-import warnings\n-\n \n def expandable_elements(context, request):\n """Returns a dict containing all expandable elements."""\n expands = request.form.get("expand", [])\n if isinstance(expands, str):\n if "," in expands:\n- # deprecated use of expands (with commas)\n- warnings.warn(\n- "``expand`` as a string parameter separated with commas is deprecated and will be removed in plone.restapi 9.0. Use ``expand:list`` instead.",\n- DeprecationWarning,\n- )\n+ # use of expands (with commas) was deprecated in plone.restapi 8\n+ # undeprecated with plone.restapi 9\n expands = expands.split(",")\n else:\n # allow still the use of non marked :list parameters present\n' +b'diff --git a/news/1697.bugfix b/news/1697.bugfix\nnew file mode 100644\nindex 000000000..3789f81a1\n--- /dev/null\n+++ b/news/1697.bugfix\n@@ -0,0 +1 @@\n+Undeprecate token parameter from vocabularies endpoint @tisto\n\\ No newline at end of file\ndiff --git a/src/plone/restapi/serializer/vocabularies.py b/src/plone/restapi/serializer/vocabularies.py\nindex 380040f2c..a8f7e6110 100644\n--- a/src/plone/restapi/serializer/vocabularies.py\n+++ b/src/plone/restapi/serializer/vocabularies.py\n@@ -11,8 +11,6 @@\n from zope.schema.interfaces import ITokenizedTerm\n from zope.schema.interfaces import IVocabulary\n \n-import warnings\n-\n \n @implementer(ISerializeToJson)\n class SerializeVocabLikeToJson:\n@@ -44,10 +42,8 @@ def __call__(self, vocabulary_id):\n )\n \n if token:\n- warnings.warn(\n- "``token`` parameter is deprecated and will be removed in plone.restapi 9.0. Use ``tokens`` parameter instead.",\n- DeprecationWarning,\n- )\n+ # the token parameter was deprecated in plone.restapi 8\n+ # undeprecated in plone.restapi 9\n if token.lower() != term.token.lower():\n continue\n terms.append(term)\n'