Edgewall Software

Opened 10 years ago

Last modified 10 years ago

#11511 closed defect

Strange message for intertrac without link — at Initial Version

Reported by: Jun Omae Owned by:
Priority: low Milestone: 0.12.6
Component: wiki system Version:
Severity: normal Keywords: intertrac
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description

http://trac.edgewall.org/demo-0.12/intertrac/r0 says the following.

Can't view r0: privileges are required to perform this operation

In this site, trac:r0 says…

Can't view r0: privileges are required to perform this operation. You don't have the required permissions.

That is wrong use of PermissionError at tags/trac-0.12.5/trac/wiki/intertrac.py@:56#L45. The message should be specified with msg keyword argument.

  • trac/wiki/intertrac.py

    diff --git a/trac/wiki/intertrac.py b/trac/wiki/intertrac.py
    index fab670c..6cd5c64 100644
    a b class InterTracDispatcher(Component):  
    5353        if isinstance(link_frag, (Element, Fragment)):
    5454            elt = find_element(link_frag, 'href')
    5555            if elt is None: # most probably no permissions to view
    56                 raise PermissionError(_("Can't view %(link)s:", link=link))
     56                raise PermissionError(msg=_("Can't view %(link)s:", link=link))
    5757            href = elt.attrib.get('href')
    5858        else:
    5959            href = req.href(link.rstrip(':'))

Change History (0)

Note: See TracTickets for help on using tickets.