Mercurial > p > roundup > code
diff roundup/cgi/form_parser.py @ 5149:cc4f4ee46d88
Fix file attribute parsing
Fix bug introduced when allowing multiple file attachments.
| author | Ralf Schlatterbeck <rsc@runtux.com> |
|---|---|
| date | Mon, 18 Jul 2016 13:21:43 +0200 |
| parents | e424987d294a |
| children | 2ae3954e972f |
line wrap: on
line diff
--- a/roundup/cgi/form_parser.py Thu Jul 14 22:03:48 2016 -0400 +++ b/roundup/cgi/form_parser.py Mon Jul 18 13:21:43 2016 +0200 @@ -594,11 +594,9 @@ # new item (any class) with no content - ignore del all_props[(cn, id)] elif isinstance(self.db.classes[cn], hyperdb.FileClass): - if id is not None and id.startswith('-'): - if not props.get('content', ''): - del all_props[(cn, id)] - elif props.has_key('content') and not props['content']: - raise FormError (self._('File is empty')) + # Avoid emptying the file + if props.has_key('content') and not props['content']: + del props ['content'] return all_props, all_links def parse_file(self, fpropdef, fprops, v):
