|
1 | | -# $Id: client.py,v 1.130.2.10 2004-02-24 21:13:26 richard Exp $ |
| 1 | +# $Id: client.py,v 1.130.2.11 2004-02-24 23:37:10 richard Exp $ |
2 | 2 |
|
3 | 3 | __doc__ = """ |
4 | 4 | WWW request handler (also used in the stand-alone server). |
@@ -243,7 +243,12 @@ def inner_main(self): |
243 | 243 |
|
244 | 244 | # possibly handle a form submit action (may change self.classname |
245 | 245 | # and self.template, and may also append error/ok_messages) |
246 | | - self.handle_action() |
| 246 | + html = self.handle_action() |
| 247 | + |
| 248 | + # if the action renders HTML, stop processing here |
| 249 | + if html: |
| 250 | + self.write(html) |
| 251 | + return |
247 | 252 |
|
248 | 253 | # now render the page |
249 | 254 | # we don't want clients caching our dynamic pages |
@@ -562,7 +567,7 @@ def handle_action(self): |
562 | 567 | else: |
563 | 568 | raise ValueError, 'No such action "%s"'%action |
564 | 569 | # call the mapped action |
565 | | - getattr(self, method)() |
| 570 | + return getattr(self, method)() |
566 | 571 | except Redirect: |
567 | 572 | raise |
568 | 573 | except Unauthorised: |
@@ -888,10 +893,16 @@ def confRegoAction(self): |
888 | 893 |
|
889 | 894 | # nice message |
890 | 895 | message = _('You are now registered, welcome!') |
891 | | - |
892 | | - # redirect to the user's page |
893 | | - raise Redirect, '%suser%s?@ok_message=%s'%(self.base, |
894 | | - self.userid, urllib.quote(message)) |
| 896 | + url = '%suser%s?@ok_message=%s'%(self.base, self.userid, |
| 897 | + urllib.quote(message)) |
| 898 | + |
| 899 | + # redirect to the user's page (but not 302, as some email clients seem |
| 900 | + # to want to reload the page, or something) |
| 901 | + return '''<html><head><title>%s</title></head> |
| 902 | + <body><p><a href="%s">%s</a></p> |
| 903 | + <script type="text/javascript"> |
| 904 | + window.setTimeout('window.location = "%s"', 1000); |
| 905 | + </script>'''%(message, url, message, url) |
895 | 906 |
|
896 | 907 | def passResetAction(self): |
897 | 908 | ''' Handle password reset requests. |
|
0 commit comments