changeset 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 afa9a2fdf777
children 847fe1d61cb0
files roundup/cgi/form_parser.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
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/