Roundup Tracker - Issues

Issue 2550843

classification
AttributeError: 'Unauthorised' object has no attribute 'replace'
Type: Severity: normal
Components: Web interface Versions: 1.5
process
Status: fixed fixed
:
: ThomasAH : ThomasAH
Priority: normal :

Created on 2014-05-22 10:49 by ThomasAH, last changed 2014-05-26 14:21 by ThomasAH.

Messages
msg5103 Author: [hidden] (ThomasAH) Date: 2014-05-22 10:49
I run an issue search in a tracker with permissions on keywords restricted:

https://roundup-intern.intevation.de/flys/issue?%40search_text=&title=&%40columns=title&keyword=51&id=&%40columns=id&creation=&creator=&activity=&%40columns=activity&%40sort=activity&actor=&deadline=&%40columns=deadline&priority=&%40group=priority&disposition=&status=&%40columns=status&assignedto=&%40columns=assignedto&links=&group_customer=&group_partner=&group_internal=&%40pagesize=500&%40startwith=0&%40queryname=&%40old-queryname=&%40action=search

This works when logged in, but when opening the same URL in a browser
window where I'm not logged in, I get the following traceback with
Roundup e56047711df2 (April 2nd, 2014):

mod_wsgi (pid=15199): Exception occurred processing WSGI script
'/srv/roundup/example/roundup.wsgi'.
Traceback (most recent call last):
  File
"/home/intevation/roundup/current/lib/python/roundup/cgi/wsgi_handler.py",
line 66, in __call__
    client.main()
  File
"/home/intevation/roundup/current/lib/python/roundup/cgi/client.py",
line 376, in main
    self.inner_main()
  File
"/home/intevation/roundup/current/lib/python/roundup/cgi/client.py",
line 538, in inner_main
    self.renderFrontPage(message)
  File
"/home/intevation/roundup/current/lib/python/roundup/cgi/client.py",
line 1092, in renderFrontPage
    self.add_error_message(message)
  File
"/home/intevation/roundup/current/lib/python/roundup/cgi/client.py",
line 415, in add_error_message
    add_message(self._error_message, msg, escape)
  File
"/home/intevation/roundup/current/lib/python/roundup/cgi/client.py",
line 53, in add_message
    msg = cgi.escape(msg).replace('\\n', '<br />\\n')
  File "/usr/lib/python2.7/cgi.py", line 1035, in escape
    s = s.replace("&", "&amp;") # Must be done first!
AttributeError: 'Unauthorised' object has no attribute 'replace'

I would expect to see the error message.
msg5104 Author: [hidden] (ThomasAH) Date: 2014-05-26 14:21
changeset:   4898:850551a1568b
tag:         tip
user:        Thomas Arendsen Hein <thomas@intevation.de>
date:        Mon May 26 16:14:07 2014 +0200
files:       CHANGES.txt roundup/cgi/client.py
description:
Fix issue2550843 (AttributeError: 'Unauthorised' object has no attribute
'replace')

Pass text of Unauthorised and Login exceptions instead of the exception
instance to avoid traceback with string operations.

str() is used in most other places where the exception error message text is
needed. So far only roundup.cgi.actions.LoginAction.handle() iterates
over the
exception args. Probably not needed here, so I decided to keep the code
simple.
History
Date User Action Args
2014-05-26 14:21:02ThomasAHsetstatus: new -> fixed
resolution: fixed
messages: + msg5104
2014-05-22 10:49:33ThomasAHcreate