Code

more fixes for backward-compatibility form entries - file edit page is busted tho
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Thu, 13 Feb 2003 11:23:46 +0000 (11:23 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Thu, 13 Feb 2003 11:23:46 +0000 (11:23 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@1504 57a73879-2fb5-44c3-a270-3262357dd7e2

roundup/cgi/client.py

index 18da380f9d5e4218d9477d8e53bd29b79b428c73..c9d51923db7ee04aa22ddf0c14e6e2b3e60af7aa 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: client.py,v 1.82 2003-02-13 07:38:34 richard Exp $
+# $Id: client.py,v 1.83 2003-02-13 11:23:46 richard Exp $
 
 __doc__ = """
 WWW request handler (also used in the stand-alone server).
@@ -1021,6 +1021,7 @@ class Client:
         if newids is None:
             newids = {}
         for (cn, nodeid), props in all_props.items():
+            print ((cn, nodeid), props)
             if int(nodeid) > 0:
                 # make changes to the node
                 props = self._changenode(cn, nodeid, props)
@@ -1273,6 +1274,12 @@ class Client:
                     # nope, pull out the value and strip it
                     value = value.value.strip()
 
+            # now that we have the props field, we need a teensy little
+            # extra bit of help for the old :note field...
+            if key == ':note' and value:
+                props['author'] = self.db.getuid()
+                props['date'] = date.Date()
+
             # handle by type now
             if isinstance(proptype, hyperdb.Password):
                 if not value:
@@ -1378,6 +1385,9 @@ class Client:
                 if isinstance(proptype, hyperdb.String):
                     if (hasattr(value, 'filename') and
                             value.filename is not None):
+                        # skip if the upload is empty
+                        if not value.filename:
+                            continue
                         # this String is actually a _file_
                         # try to determine the file content-type
                         filename = value.filename.split('\\')[-1]