summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b3f2ac4)
raw | patch | inline | side by side (parent: b3f2ac4)
author | jlgijsbers <jlgijsbers@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 10 Aug 2003 13:38:43 +0000 (13:38 +0000) | ||
committer | jlgijsbers <jlgijsbers@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Sun, 10 Aug 2003 13:38:43 +0000 (13:38 +0000) |
'content' property in the form when editing properties, other changes wold be
discarded silently. Now, an exception is raised when there is a empty content
property. Also, when there is no content property, other attributes can be
edited.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1799 57a73879-2fb5-44c3-a270-3262357dd7e2
discarded silently. Now, an exception is raised when there is a empty content
property. Also, when there is no content property, other attributes can be
edited.
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1799 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/cgi/client.py | patch | blob | history |
diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py
index 6ee905f53e7b2b65ae0e114b2da8f6b17e4edf4e..097a48d3e1007552b572ae2abd75ef8d88183c82 100644 (file)
--- a/roundup/cgi/client.py
+++ b/roundup/cgi/client.py
-# $Id: client.py,v 1.127 2003-08-10 10:30:56 jlgijsbers Exp $
+# $Id: client.py,v 1.128 2003-08-10 13:38:43 jlgijsbers Exp $
__doc__ = """
WWW request handler (also used in the stand-alone server).
if s:
raise ValueError, '\n'.join(s)
- # check that FileClass entries have a "content" property with
- # content, otherwise remove them
+ # When creating a FileClass node, it should have a non-empty content
+ # property to be created. When editing a FileClass node, it should
+ # 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():
- cl = self.db.classes[cn]
- if not isinstance(cl, hyperdb.FileClass):
- continue
- # we also don't want to create FileClass items with no content
- if not props.get('content', ''):
- del all_props[(cn, id)]
+ if isinstance(self.db.classes[cn], hyperdb.FileClass):
+ if id == '-1':
+ if not props.get('content', ''):
+ del all_props[(cn, id)]
+ elif props.has_key('content') and not props['content']:
+ raise ValueError, _('File is empty')
return all_props, all_links
def fixNewlines(text):