-
-
Notifications
You must be signed in to change notification settings - Fork 75
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Branch: refs/heads/main Date: 2024-11-05T14:07:54-08:00 Author: David Glick (davisagli) <[email protected]> Commit: plone/plone.restapi@8297ad9 Preparing release 9.8.4 Files changed: M CHANGES.rst M setup.py D news/1837.bugfix Repository: plone.restapi Branch: refs/heads/main Date: 2024-11-05T14:09:56-08:00 Author: David Glick (davisagli) <[email protected]> Commit: plone/plone.restapi@9f0feff Back to development: 9.8.5 Files changed: M setup.py
- Loading branch information
Showing
1 changed file
with
21 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,19 +2,31 @@ Repository: plone.restapi | |
|
||
|
||
Branch: refs/heads/main | ||
Date: 2024-11-05T12:55:02-08:00 | ||
Date: 2024-11-05T14:07:54-08:00 | ||
Author: David Glick (davisagli) <[email protected]> | ||
Commit: https://github.com/plone/plone.restapi/commit/636ef37ecf1fce3de17c80fa29e6cac7e6ffbcac | ||
Commit: https://github.com/plone/plone.restapi/commit/8297ad9f103844509f2ef2e21b05edb3cbc88a56 | ||
|
||
Fix handling of errors in aliases CSV upload (#1838) | ||
Preparing release 9.8.4 | ||
|
||
* Fix handling of errors in aliases CSV upload | ||
|
||
* changelog | ||
Files changed: | ||
M CHANGES.rst | ||
M setup.py | ||
D news/1837.bugfix | ||
|
||
b'diff --git a/CHANGES.rst b/CHANGES.rst\nindex 3e6cc99b82..252e57258f 100644\n--- a/CHANGES.rst\n+++ b/CHANGES.rst\n@@ -8,6 +8,15 @@ Changelog\n \n .. towncrier release notes start\n \n+9.8.4 (2024-11-05)\n+------------------\n+\n+Bug fixes:\n+\n+\n+- URL Management control panel: Fix error handling in CSV upload. @davisagli (#1837)\n+\n+\n 9.8.3 (2024-11-01)\n ------------------\n \ndiff --git a/news/1837.bugfix b/news/1837.bugfix\ndeleted file mode 100644\nindex 08502b6c36..0000000000\n--- a/news/1837.bugfix\n+++ /dev/null\n@@ -1 +0,0 @@\n-URL Management control panel: Fix error handling in CSV upload. @davisagli\ndiff --git a/setup.py b/setup.py\nindex dc007c4c1f..2cf2760837 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -4,7 +4,7 @@\n import sys\n \n \n-version = "9.8.4.dev0"\n+version = "9.8.4"\n \n if sys.version_info.major == 2:\n raise ValueError(\n' | ||
|
||
Repository: plone.restapi | ||
|
||
|
||
Branch: refs/heads/main | ||
Date: 2024-11-05T14:09:56-08:00 | ||
Author: David Glick (davisagli) <[email protected]> | ||
Commit: https://github.com/plone/plone.restapi/commit/9f0feffad288f18e5fa3d3f63094614971d1d164 | ||
|
||
Back to development: 9.8.5 | ||
|
||
Files changed: | ||
A news/1837.bugfix | ||
M src/plone/restapi/services/aliases/add.py | ||
M setup.py | ||
|
||
b'diff --git a/news/1837.bugfix b/news/1837.bugfix\nnew file mode 100644\nindex 0000000000..08502b6c36\n--- /dev/null\n+++ b/news/1837.bugfix\n@@ -0,0 +1 @@\n+URL Management control panel: Fix error handling in CSV upload. @davisagli\ndiff --git a/src/plone/restapi/services/aliases/add.py b/src/plone/restapi/services/aliases/add.py\nindex e54ccc0c67..2894d25b22 100644\n--- a/src/plone/restapi/services/aliases/add.py\n+++ b/src/plone/restapi/services/aliases/add.py\n@@ -101,12 +101,22 @@ def _reply_csv(self):\n raise BadRequest("Uploaded file is not a valid CSV file")\n \n controlpanel = RedirectsControlPanel(self.context, self.request)\n+ csv_errors = controlpanel.csv_errors = []\n storage = getUtility(IRedirectionStorage)\n status = IStatusMessage(self.request)\n portal = getSite()\n controlpanel.upload(file, portal, storage, status)\n file.close()\n \n+ if csv_errors:\n+ self.request.response.setHeader("Content-Type", "application/json")\n+ self.request.response.setStatus(BadRequest)\n+ return {\n+ "type": "BadRequest",\n+ "message": f"Found {len(csv_errors)} errors in CSV file.",\n+ # Skip first item which is a notice about the delimiter\n+ "csv_errors": csv_errors[1:],\n+ }\n if err := status.show():\n if err[0].type == "error":\n raise BadRequest(err[0].message)\n' | ||
b'diff --git a/setup.py b/setup.py\nindex 2cf276083..69b2ff718 100644\n--- a/setup.py\n+++ b/setup.py\n@@ -4,7 +4,7 @@\n import sys\n \n \n-version = "9.8.4"\n+version = "9.8.5.dev0"\n \n if sys.version_info.major == 2:\n raise ValueError(\n' | ||
|