summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 3c4619d)
raw | patch | inline | side by side (parent: 3c4619d)
author | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 25 Feb 2004 03:24:43 +0000 (03:24 +0000) | ||
committer | richard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2> | |
Wed, 25 Feb 2004 03:24:43 +0000 (03:24 +0000) |
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/trunk@2114 57a73879-2fb5-44c3-a270-3262357dd7e2
roundup/cgi/actions.py | patch | blob | history | |
roundup/cgi/client.py | patch | blob | history |
diff --git a/roundup/cgi/actions.py b/roundup/cgi/actions.py
index 36a4d9dc1b1127b3c3d217eaa3bfde3b319a298f..ceb89bb8344443d962e1e3a98c7a276222b7acb8 100755 (executable)
--- a/roundup/cgi/actions.py
+++ b/roundup/cgi/actions.py
# 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 '''<html><head><title>%s</title></head>
+ <body><p><a href="%s">%s</a></p>
+ <script type="text/javascript">
+ window.setTimeout('window.location = "%s"', 1000);
+ </script>'''%(message, url, message, url)
class RegisterAction(Action):
name = 'register'
diff --git a/roundup/cgi/client.py b/roundup/cgi/client.py
index 4a2a78d1fa4f0d01c6e8b7b88a7c945184571d1d..57fdd110c9ca6a4bd0a4bdb93b33257899b2c5f1 100644 (file)
--- a/roundup/cgi/client.py
+++ b/roundup/cgi/client.py
-# $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).
"""
# 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
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()
# 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))