[Twisted-web] /freeform_post!!random causes exceptions

Andrea Arcangeli andrea at cpushare.com
Mon Jan 10 03:18:55 MST 2005

This fixes a server exception that you can trigger by using an url like
the one in subject on a page that misses the binding.

This fixed the problem for my application, it's probably the right fix
too. I noticed it after logging out of the session and pressing some
back on the web browser, the forms that were valid inside the account,
weren't valid in the guest area and caused exceptions.

BTW, I wrote an exception handler that sends me any exception by email
and redirects the user to a nice message (so you can debug any problem
before people complains and you don't show the sensitive data to the
user) if the client IP is != localhost (so you can still debug it great
with the formatter in localhost). If anybody wants to see the code or to
merge it into nevow feel free to ask (though it depends on twisted for
delivering the email).

Index: nevow/rend.py
--- nevow/rend.py	(revision 1057)
+++ nevow/rend.py	(working copy)
@@ -127,7 +127,8 @@
             ctx.remember(request, inevow.IRequest)
             cf = iformless.IConfigurableFactory(self)
             c = cf.locateConfigurable(ctx, configurableName)
-            return self.webFormPost(request, self, c, ctx, bindingName, request.args)
+            if c:
+                return self.webFormPost(request, self, c, ctx, bindingName, request.args)
         return NotFound

More information about the Twisted-web mailing list