diff roundup/cgi/form_parser.py @ 4049:c9a8a47c4666

Do not try to create empty nodes with a negative ID.
author Stefan Seefeld <stefan@seefeld.name>
date Thu, 19 Feb 2009 20:00:44 +0000
parents 3167ad1c19cd
children a412ce8ccf6f
line wrap: on
line diff
--- a/roundup/cgi/form_parser.py	Tue Feb 17 13:05:44 2009 +0000
+++ b/roundup/cgi/form_parser.py	Thu Feb 19 20:00:44 2009 +0000
@@ -563,11 +563,11 @@
         # either have a non-empty content property or no property at all. In
         # the latter case, nothing will change.
         for (cn, id), props in all_props.items():
-            if id and id.startswith('-') and not props:
+            if id is not None and id.startswith('-') and not props:
                 # new item (any class) with no content - ignore
                 del all_props[(cn, id)]
             elif isinstance(self.db.classes[cn], hyperdb.FileClass):
-                if id and id.startswith('-'):
+                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']:

Roundup Issue Tracker: http://roundup-tracker.org/