Skip to content

Commit 4489f65

Browse files
author
Richard Jones
committed
fixed rego from email address [SF#947414]
1 parent 3d78958 commit 4489f65

File tree

4 files changed

+32
-16
lines changed

4 files changed

+32
-16
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Fixed:
1414
- fixed handling of key values starting with numbers (sf bug 941363)
1515
- fixed journal "param" column size in RDBMS backends
1616
- fixed static file serving
17+
- fixed rego from email address (sf bug 947414)
1718

1819

1920
2004-04-18 0.7.0b3

roundup/backends/rdbms_common.py

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: rdbms_common.py,v 1.96 2004-05-02 23:16:05 richard Exp $
1+
# $Id: rdbms_common.py,v 1.97 2004-05-04 05:56:48 richard Exp $
22
''' Relational database (SQL) backend common code.
33
44
Basics:
@@ -981,6 +981,8 @@ def addjournal(self, classname, nodeid, action, params, creator=None,
981981
if isinstance(params, type({})):
982982
properties = self.getclass(classname).getprops()
983983
for param, value in params.items():
984+
if not value:
985+
continue
984986
property = properties[param]
985987
cvt = self.hyperdb_to_sql_value[property.__class__]
986988
if isinstance(property, Password):
@@ -1032,17 +1034,20 @@ def getjournal(self, classname, nodeid):
10321034
properties = self.getclass(classname).getprops()
10331035
for nodeid, date_stamp, user, action, params in journal:
10341036
params = eval(params)
1035-
for param, value in params.items():
1036-
property = properties[param]
1037-
cvt = self.sql_to_hyperdb_value[property.__class__]
1038-
if isinstance(property, Password):
1039-
params[param] = cvt(value)
1040-
elif isinstance(property, Date):
1041-
params[param] = cvt(value)
1042-
elif isinstance(property, Interval):
1043-
params[param] = cvt(value)
1044-
elif isinstance(property, Boolean):
1045-
params[param] = cvt(value)
1037+
if isinstance(params, type({})):
1038+
for param, value in params.items():
1039+
if not value:
1040+
continue
1041+
property = properties[param]
1042+
cvt = self.sql_to_hyperdb_value[property.__class__]
1043+
if isinstance(property, Password):
1044+
params[param] = cvt(value)
1045+
elif isinstance(property, Date):
1046+
params[param] = cvt(value)
1047+
elif isinstance(property, Interval):
1048+
params[param] = cvt(value)
1049+
elif isinstance(property, Boolean):
1050+
params[param] = cvt(value)
10461051
# XXX numeric ids
10471052
res.append((str(nodeid), dc(date_stamp), user, action, params))
10481053
return res

roundup/cgi/actions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#$Id: actions.py,v 1.24 2004-05-02 23:16:05 richard Exp $
1+
#$Id: actions.py,v 1.25 2004-05-04 05:56:54 richard Exp $
22

33
import re, cgi, StringIO, urllib, Cookie, time, random
44

@@ -746,7 +746,7 @@ def handle(self):
746746
""" % {'name': props['username'], 'tracker': tracker_name, 'url': self.base,
747747
'otk': otk, 'tracker_email': tracker_email}
748748
if not self.client.standard_message([props['address']], subject,
749-
body, tracker_email):
749+
body, (tracker_name, tracker_email)):
750750
return
751751

752752
# commit changes to the database

roundup/cgi/client.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# $Id: client.py,v 1.175 2004-05-04 00:02:18 richard Exp $
1+
# $Id: client.py,v 1.176 2004-05-04 05:56:54 richard Exp $
22

33
"""WWW request handler (also used in the stand-alone server).
44
"""
@@ -670,11 +670,21 @@ def opendb(self, user):
670670
self.db = self.instance.open(user)
671671

672672
def standard_message(self, to, subject, body, author=None):
673+
'''Send a standard email message from Roundup.
674+
675+
"to" - recipients list
676+
"subject" - Subject
677+
"body" - Message
678+
"author" - (name, address) tuple or None for admin email
679+
680+
Arguments are passed to the Mailer.standard_message code.
681+
'''
673682
try:
674683
self.mailer.standard_message(to, subject, body, author)
675-
return 1
676684
except MessageSendError, e:
677685
self.error_message.append(str(e))
686+
return 0
687+
return 1
678688

679689
def parsePropsFromForm(self, create=0):
680690
return FormParser(self).parse(create=create)

0 commit comments

Comments
 (0)