Skip to content

Commit a067e6a

Browse files
author
Alexander Smishlajev
committed
disable node creation if no properties are set
1 parent a5a7eee commit a067e6a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

roundup/cgi/form_parser.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,10 @@ def parse(self, create=0, num_re=re.compile('^\d+$')):
521521
# either have a non-empty content property or no property at all. In
522522
# the latter case, nothing will change.
523523
for (cn, id), props in all_props.items():
524-
if isinstance(self.db.classes[cn], hyperdb.FileClass):
524+
if (id == '-1') and not props:
525+
# new item (any class) with no content - ignore
526+
del all_props[(cn, id)]
527+
elif isinstance(self.db.classes[cn], hyperdb.FileClass):
525528
if id == '-1':
526529
if not props.get('content', ''):
527530
del all_props[(cn, id)]

0 commit comments

Comments
 (0)