Skip to content

Commit 5286d32

Browse files
author
Michael Howitz
authored
Fix behavior when uploading no file in Zope >= 5.8.1. (#62)
1 parent b31dc72 commit 5286d32

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

CHANGES.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ Changelog
44
5.1 (unreleased)
55
----------------
66

7+
- Fix behavior when uploading no file in ``Zope >= 5.8.1``.
8+
79

810
5.0 (2023-02-01)
911
----------------

src/Products/PythonScripts/PythonScript.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,12 @@ def ZPythonScriptHTML_upload(self, REQUEST, file=''):
179179
if self.wl_isLocked():
180180
raise ResourceLockedError('The script is locked via WebDAV.')
181181

182+
if not file:
183+
return self.ZPythonScriptHTML_editForm(
184+
self, REQUEST,
185+
manage_tabs_message='No file specified',
186+
manage_tabs_type='warning')
182187
if not isinstance(file, str):
183-
if not file:
184-
return self.ZPythonScriptHTML_editForm(
185-
self, REQUEST,
186-
manage_tabs_message='No file specified',
187-
manage_tabs_type='warning')
188188
file = file.read()
189189

190190
self.write(file)

0 commit comments

Comments
 (0)