[Python-apps-team] Bug#634800: trac reports attributeError after login with libapache2-mod-auth-openid

Jamie McClelland jm at mayfirst.org
Wed Jul 20 00:31:21 UTC 2011


Package: trac
Version:  0.11.7-4

I've configured trac to use libapache2-mod-auth-openid for
authentication. 

I've written a custom login page for libapache2-mod-auth-openid that
includes a post value for referer that is set to the original web page
that user was on when they clicked the login link.

I expect the user to be redirected to this page after a successful
login.

Instead, after logging in, I'm returned to trac and get the error:

Trac detected an internal error:

AttributeError: 'list' object has no attribute 'startswith'

I've fixed the error with the following patch:

--- /usr/share/pyshared/trac/web/auth.py.orig 2011-07-19 09:55:03.000000000 -0400
+++ /usr/share/pyshared/trac/web/auth.py  2011-07-19 10:31:35.000000000 -0400
@@ -209,7 +209,7 @@
         req.redirect(referer or req.abs_href())
 
     def _referer(self, req):
-        return req.args.get('referer') or req.get_header('Referer')
+        return req.args.getfirst('referer') or req.get_header('Referer')
 
 
 class HTTPAuthentication(object):



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.alioth.debian.org/pipermail/python-apps-team/attachments/20110719/8564d13c/attachment.pgp>


More information about the Python-apps-team mailing list