Skip to content

Commit

Permalink
Merge branch 'main' into serializer_bug_1745
Browse files Browse the repository at this point in the history
  • Loading branch information
Faakhir30 authored Oct 2, 2024
2 parents 8c67abe + 6e5e669 commit 938bd1f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 2 additions & 2 deletions docs/source/contributing/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions news/1822.documentation
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed spelling of prerequisites. @stevepiercy
9 changes: 7 additions & 2 deletions src/plone/restapi/services/aliases/add.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import plone.protect.interfaces
import logging

logger = logging.getLogger("Plone")
logger = logging.getLogger(__name__)


@implementer(IPublishTraverse)
Expand Down Expand Up @@ -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()

Expand Down

0 comments on commit 938bd1f

Please sign in to comment.