Mercurial > p > roundup > code
diff roundup/cgi/client.py @ 2045:d124af927369
Forward-porting of fixes from the maintenance branch.
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Wed, 25 Feb 2004 03:24:43 +0000 |
| parents | 5a7ec0c63095 |
| children | f913b6beac35 |
line wrap: on
line diff
--- a/roundup/cgi/client.py Mon Feb 23 17:19:09 2004 +0000 +++ b/roundup/cgi/client.py Wed Feb 25 03:24:43 2004 +0000 @@ -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 @@ # 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 @@ 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 @@ # 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))
