Skip to content

Commit

Permalink
Merge pull request #2288 from BirkbeckCTP/fix_save_galley
Browse files Browse the repository at this point in the history
Fixes save_galley for file paths.
  • Loading branch information
mauromsl authored Jul 28, 2021
2 parents 927b845 + 2e4daf6 commit 6bd1c31
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/production/logic.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,14 @@ def save_source_file(article, request, uploaded_file):


def save_galley(article, request, uploaded_file, is_galley, label=None, save_to_disk=True):
mime = files.guess_mime(uploaded_file.name)
if isinstance(uploaded_file, str):
mime = files.file_path_mime(uploaded_file)
else:
mime = files.guess_mime(uploaded_file.name)

if mime == "application/zip":
raise ZippedGalleyError("Zip galleys are not supported")

new_file = files.save_file_to_article(
uploaded_file,
article,
Expand Down

0 comments on commit 6bd1c31

Please sign in to comment.