diff roundup/cgi/form_parser.py @ 3266:09304fa9d78c maint-0.8

disable node creation if no properties are set
author Alexander Smishlajev <a1s@users.sourceforge.net>
date Thu, 07 Apr 2005 06:28:51 +0000
parents 9260152ad143
children 0e5f15520e70
line wrap: on
line diff
--- a/roundup/cgi/form_parser.py	Thu Apr 07 06:20:11 2005 +0000
+++ b/roundup/cgi/form_parser.py	Thu Apr 07 06:28:51 2005 +0000
@@ -521,7 +521,10 @@
         # 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 isinstance(self.db.classes[cn], hyperdb.FileClass):
+            if (id == '-1') 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 == '-1':
                     if not props.get('content', ''):
                         del all_props[(cn, id)]

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