Skip to content

Commit a797a32

Browse files
author
Richard Jones
committed
more fixes for backward-compatibility form entries
file edit page is busted tho
1 parent 9102ae5 commit a797a32

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

roundup/cgi/client.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.82 2003-02-13 07:38:34 richard Exp $
1+
# $Id: client.py,v 1.83 2003-02-13 11:23:46 richard Exp $
22

33
__doc__ = """
44
WWW request handler (also used in the stand-alone server).
@@ -1021,6 +1021,7 @@ def _editnodes(self, all_props, all_links, newids=None):
10211021
if newids is None:
10221022
newids = {}
10231023
for (cn, nodeid), props in all_props.items():
1024+
print ((cn, nodeid), props)
10241025
if int(nodeid) > 0:
10251026
# make changes to the node
10261027
props = self._changenode(cn, nodeid, props)
@@ -1273,6 +1274,12 @@ def parsePropsFromForm(self, num_re=re.compile('^\d+$')):
12731274
# nope, pull out the value and strip it
12741275
value = value.value.strip()
12751276

1277+
# now that we have the props field, we need a teensy little
1278+
# extra bit of help for the old :note field...
1279+
if key == ':note' and value:
1280+
props['author'] = self.db.getuid()
1281+
props['date'] = date.Date()
1282+
12761283
# handle by type now
12771284
if isinstance(proptype, hyperdb.Password):
12781285
if not value:
@@ -1378,6 +1385,9 @@ def parsePropsFromForm(self, num_re=re.compile('^\d+$')):
13781385
if isinstance(proptype, hyperdb.String):
13791386
if (hasattr(value, 'filename') and
13801387
value.filename is not None):
1388+
# skip if the upload is empty
1389+
if not value.filename:
1390+
continue
13811391
# this String is actually a _file_
13821392
# try to determine the file content-type
13831393
filename = value.filename.split('\\')[-1]

0 commit comments

Comments
 (0)