diff --git a/docs/source/contributing/index.md b/docs/source/contributing/index.md index 1c0c9ac617..f442e71306 100644 --- a/docs/source/contributing/index.md +++ b/docs/source/contributing/index.md @@ -13,9 +13,9 @@ This section describes how to contribute to the `plone.restapi` project. It extends {doc}`plone:contributing/index`. -## Pre-requisites +## Prerequisites -Prepare your system by installing {ref}`plone:plone-pre-requisites-label`. +Prepare your system by installing {ref}`plone:plone-prerequisites-label`. ## Set up development environment diff --git a/news/1822.documentation b/news/1822.documentation new file mode 100644 index 0000000000..c37ab93222 --- /dev/null +++ b/news/1822.documentation @@ -0,0 +1 @@ +Fixed spelling of prerequisites. @stevepiercy diff --git a/src/plone/restapi/services/aliases/add.py b/src/plone/restapi/services/aliases/add.py index ab8af1ed2a..e54ccc0c67 100644 --- a/src/plone/restapi/services/aliases/add.py +++ b/src/plone/restapi/services/aliases/add.py @@ -18,7 +18,7 @@ import plone.protect.interfaces import logging -logger = logging.getLogger("Plone") +logger = logging.getLogger(__name__) @implementer(IPublishTraverse) @@ -94,11 +94,16 @@ def _reply_csv(self): form = self.request.form if not form.get("file"): raise BadRequest("No file uploaded") + + file = form["file"] + + if file.headers.get("Content-Type") not in ("text/csv", "application/csv"): + raise BadRequest("Uploaded file is not a valid CSV file") + controlpanel = RedirectsControlPanel(self.context, self.request) storage = getUtility(IRedirectionStorage) status = IStatusMessage(self.request) portal = getSite() - file = form["file"] controlpanel.upload(file, portal, storage, status) file.close()