Skip to content

Commit ef48d5c

Browse files
author
Richard Jones
committed
login_action and newuser_action return values were being ignored
Woohoo! Found that bloody re-login bug that was killing the mail gateway. (also a minor cleanup in hyperdb)
1 parent 9c4d4bd commit ef48d5c

File tree

4 files changed

+41
-9
lines changed

4 files changed

+41
-9
lines changed

CHANGES.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ Feature:
1313

1414
Fixed:
1515
. Lots of bugs, thanks Roch� and others on the devel mailing list!
16+
. login_action and newuser_action return values were being ignored
17+
. Woohoo! Found that bloody re-login bug that was killing the mail
18+
gateway.
1619

1720

1821
2001-11-23 - 0.3.0

roundup/cgi_client.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: cgi_client.py,v 1.66 2001-11-27 03:00:50 richard Exp $
18+
# $Id: cgi_client.py,v 1.67 2001-11-28 21:55:35 richard Exp $
1919

2020
__doc__ = """
2121
WWW request handler (also used in the stand-alone server).
@@ -711,6 +711,7 @@ def login_action(self, message=None):
711711
return self.login(message=_('Incorrect password'))
712712

713713
self.set_cookie(self.user, password)
714+
return None # make it explicit
714715

715716
def set_cookie(self, user, password):
716717
# construct the cookie
@@ -761,7 +762,7 @@ def newuser_action(self, message=None):
761762
self.user = cl.get(uid, 'username')
762763
password = cl.get(uid, 'password')
763764
self.set_cookie(self.user, self.form['password'].value)
764-
return self.index()
765+
return None # make the None explicit
765766

766767
def main(self):
767768
# determine the uid to use
@@ -815,7 +816,9 @@ def main(self):
815816
# everyone is allowed to try to log in
816817
if action == 'login_action':
817818
# do the login
818-
self.login_action()
819+
ret = self.login_action()
820+
if ret is not None:
821+
return ret
819822
# figure the resulting page
820823
action = self.form['__destination_url'].value
821824
if not action:
@@ -832,7 +835,9 @@ def main(self):
832835
else:
833836
return self.login(action=action)
834837
# add the user
835-
self.newuser_action()
838+
ret = self.newuser_action()
839+
if ret is not None:
840+
return ret
836841
# figure the resulting page
837842
action = self.form['__destination_url'].value
838843
if not action:
@@ -1041,6 +1046,9 @@ def parsePropsFromForm(db, cl, form, nodeid=0):
10411046

10421047
#
10431048
# $Log: not supported by cvs2svn $
1049+
# Revision 1.66 2001/11/27 03:00:50 richard
1050+
# couple of bugfixes from latest patch integration
1051+
#
10441052
# Revision 1.65 2001/11/26 23:00:53 richard
10451053
# This config stuff is getting to be a real mess...
10461054
#

roundup/hyperdb.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
# BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE,
1616
# SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
1717
#
18-
# $Id: hyperdb.py,v 1.36 2001-11-27 03:16:09 richard Exp $
18+
# $Id: hyperdb.py,v 1.37 2001-11-28 21:55:35 richard Exp $
1919

2020
__doc__ = """
2121
Hyperdatabase implementation, especially field types.
@@ -158,11 +158,13 @@ def create(self, **propvalues):
158158
value = self.db.classes[link_class].lookup(value)
159159
except:
160160
raise IndexError, 'new property "%s": %s not a %s'%(
161-
key, value, self.properties[key].classname)
162-
propvalues[key] = value
163-
if not self.db.hasnode(link_class, value):
161+
key, value, link_class)
162+
elif not self.db.hasnode(link_class, value):
164163
raise IndexError, '%s has no node %s'%(link_class, value)
165164

165+
# save off the value
166+
propvalues[key] = value
167+
166168
# register the link with the newly linked node
167169
self.db.addjournal(link_class, value, 'link',
168170
(self.classname, newid, key))
@@ -867,6 +869,9 @@ def Choice(name, *options):
867869

868870
#
869871
# $Log: not supported by cvs2svn $
872+
# Revision 1.36 2001/11/27 03:16:09 richard
873+
# Another place that wasn't handling missing properties.
874+
#
870875
# Revision 1.35 2001/11/22 15:46:42 jhermann
871876
# Added module docstrings to all modules.
872877
#

roundup/mailgw.py

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class node. Any parts of other types are each stored in separate files
7373
an exception, the original message is bounced back to the sender with the
7474
explanatory message given in the exception.
7575
76-
$Id: mailgw.py,v 1.36 2001-11-26 22:55:56 richard Exp $
76+
$Id: mailgw.py,v 1.37 2001-11-28 21:55:35 richard Exp $
7777
'''
7878

7979

@@ -354,6 +354,10 @@ def handle_message(self, message):
354354
username = self.db.user.get(author, 'username')
355355
self.db.close()
356356
self.db = self.instance.open(username)
357+
358+
# re-get the class with the new database connection
359+
cl = self.db.getclass(classname)
360+
357361
# now update the recipients list
358362
recipients = []
359363
tracker_email = self.ISSUE_TRACKER_EMAIL.lower()
@@ -590,6 +594,18 @@ def parseContent(content, blank_line=re.compile(r'[\r\n]+\s*[\r\n]+'),
590594

591595
#
592596
# $Log: not supported by cvs2svn $
597+
# Revision 1.36 2001/11/26 22:55:56 richard
598+
# Feature:
599+
# . Added INSTANCE_NAME to configuration - used in web and email to identify
600+
# the instance.
601+
# . Added EMAIL_SIGNATURE_POSITION to indicate where to place the roundup
602+
# signature info in e-mails.
603+
# . Some more flexibility in the mail gateway and more error handling.
604+
# . Login now takes you to the page you back to the were denied access to.
605+
#
606+
# Fixed:
607+
# . Lots of bugs, thanks Roché and others on the devel mailing list!
608+
#
593609
# Revision 1.35 2001/11/22 15:46:42 jhermann
594610
# Added module docstrings to all modules.
595611
#

0 commit comments

Comments
 (0)