Skip to content

Commit 0303723

Browse files
committed
Fix file attribute parsing
Fix bug introduced when allowing multiple file attachments.
1 parent 99c8401 commit 0303723

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

roundup/cgi/form_parser.py

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -594,11 +594,9 @@ def parse(self, create=0, num_re=re.compile('^\d+$')):
594594
# new item (any class) with no content - ignore
595595
del all_props[(cn, id)]
596596
elif isinstance(self.db.classes[cn], hyperdb.FileClass):
597-
if id is not None and id.startswith('-'):
598-
if not props.get('content', ''):
599-
del all_props[(cn, id)]
600-
elif props.has_key('content') and not props['content']:
601-
raise FormError (self._('File is empty'))
597+
# Avoid emptying the file
598+
if props.has_key('content') and not props['content']:
599+
del props ['content']
602600
return all_props, all_links
603601

604602
def parse_file(self, fpropdef, fprops, v):

0 commit comments

Comments
 (0)