comparison 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
comparison
equal deleted inserted replaced
3265:afa9a2fdf777 3266:09304fa9d78c
519 # When creating a FileClass node, it should have a non-empty content 519 # When creating a FileClass node, it should have a non-empty content
520 # property to be created. When editing a FileClass node, it should 520 # property to be created. When editing a FileClass node, it should
521 # either have a non-empty content property or no property at all. In 521 # either have a non-empty content property or no property at all. In
522 # the latter case, nothing will change. 522 # the latter case, nothing will change.
523 for (cn, id), props in all_props.items(): 523 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):
525 if id == '-1': 528 if id == '-1':
526 if not props.get('content', ''): 529 if not props.get('content', ''):
527 del all_props[(cn, id)] 530 del all_props[(cn, id)]
528 elif props.has_key('content') and not props['content']: 531 elif props.has_key('content') and not props['content']:
529 raise FormError, self._('File is empty') 532 raise FormError, self._('File is empty')

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