From 53ea64cdb21d7beee1f69c3b7057d97ec4e84a74 Mon Sep 17 00:00:00 2001 From: richard Date: Wed, 25 Feb 2004 03:24:43 +0000 Subject: [PATCH] Forward-porting of fixes from the maintenance branch. git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2114 57a73879-2fb5-44c3-a270-3262357dd7e2 --- roundup/cgi/actions.py | 14 ++++++++++---- roundup/cgi/client.py | 15 +++++++++++---- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/roundup/cgi/actions.py b/roundup/cgi/actions.py index 36a4d9d..ceb89bb 100755 --- a/roundup/cgi/actions.py +++ b/roundup/cgi/actions.py @@ -637,10 +637,16 @@ class ConfRegoAction(Action): # nice message message = _('You are now registered, welcome!') - - # redirect to the user's page - raise Redirect, '%suser%s?@ok_message=%s'%(self.base, - self.userid, urllib.quote(message)) + url = '%suser%s?@ok_message=%s'%(self.base, self.userid, + urllib.quote(message)) + + # redirect to the user's page (but not 302, as some email clients seem + # to want to reload the page, or something) + return '''%s +

%s

+ '''%(message, url, message, url) class RegisterAction(Action): name = 'register' diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py index 4a2a78d..57fdd11 100644 --- a/roundup/cgi/client.py +++ b/roundup/cgi/client.py @@ -1,4 +1,4 @@ -# $Id: client.py,v 1.162 2004-02-20 03:48:16 richard Exp $ +# $Id: client.py,v 1.163 2004-02-25 03:24:43 richard Exp $ """WWW request handler (also used in the stand-alone server). """ @@ -190,7 +190,11 @@ class Client: # possibly handle a form submit action (may change self.classname # and self.template, and may also append error/ok_messages) - self.handle_action() + html = self.handle_action() + + if html: + self.write(html) + return # now render the page # we don't want clients caching our dynamic pages @@ -538,6 +542,9 @@ class Client: The action is defined by the form variable :action which identifies the method on this object to call. The actions are defined in the "actions" sequence on this class. + + Actions may return a page (by default HTML) to return to the + user, bypassing the usual template rendering. ''' if self.form.has_key(':action'): action = self.form[':action'].value.lower() @@ -556,9 +563,9 @@ class Client: # call the mapped action if isinstance(action_klass, type('')): # old way of specifying actions - getattr(self, action_klass)() + return getattr(self, action_klass)() else: - action_klass(self).execute() + return action_klass(self).execute() except ValueError, err: self.error_message.append(str(err)) -- 2.30.2