Additional fix for #845 (in case of error)

This commit is contained in:
Ozzieisaacs
2019-03-26 18:19:39 +01:00
parent 8923e71220
commit 4b301a7961
2 changed files with 11 additions and 15 deletions

View File

@@ -3778,8 +3778,7 @@ def upload():
try:
os.unlink(meta.file_path)
except OSError:
flash(_(u"Failed to delete file %(file)s (Permission denied).", file= meta.file_path),
category="warning")
return Response(_(u"Failed to delete file %(file)s (Permission denied).", file= meta.file_path)), 422
if meta.cover is None:
has_cover = 0