|
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 $ |
2 | 2 |
|
3 | 3 | __doc__ = """ |
4 | 4 | WWW request handler (also used in the stand-alone server). |
@@ -1021,6 +1021,7 @@ def _editnodes(self, all_props, all_links, newids=None): |
1021 | 1021 | if newids is None: |
1022 | 1022 | newids = {} |
1023 | 1023 | for (cn, nodeid), props in all_props.items(): |
| 1024 | + print ((cn, nodeid), props) |
1024 | 1025 | if int(nodeid) > 0: |
1025 | 1026 | # make changes to the node |
1026 | 1027 | props = self._changenode(cn, nodeid, props) |
@@ -1273,6 +1274,12 @@ def parsePropsFromForm(self, num_re=re.compile('^\d+$')): |
1273 | 1274 | # nope, pull out the value and strip it |
1274 | 1275 | value = value.value.strip() |
1275 | 1276 |
|
| 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 | + |
1276 | 1283 | # handle by type now |
1277 | 1284 | if isinstance(proptype, hyperdb.Password): |
1278 | 1285 | if not value: |
@@ -1378,6 +1385,9 @@ def parsePropsFromForm(self, num_re=re.compile('^\d+$')): |
1378 | 1385 | if isinstance(proptype, hyperdb.String): |
1379 | 1386 | if (hasattr(value, 'filename') and |
1380 | 1387 | value.filename is not None): |
| 1388 | + # skip if the upload is empty |
| 1389 | + if not value.filename: |
| 1390 | + continue |
1381 | 1391 | # this String is actually a _file_ |
1382 | 1392 | # try to determine the file content-type |
1383 | 1393 | filename = value.filename.split('\\')[-1] |
|
0 commit comments