Edgewall Software

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#11511 closed defect (fixed)

Strange message for intertrac without link — at Version 4

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

Backported [12048] for #11283.

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 (4)

comment:1 by Ryan J Ollos, 10 years ago

Changes were recently made on 1.0-stable to address this. See #11283. I guess I should have backported the changes to 0.12-stable.

comment:2 by Jun Omae, 10 years ago

Thanks for pointer and suggestion. The issue doesn't exist on 1.0-stable.

But I don't want a new translation message by backport of the changes on 0.12-stable.

comment:3 by Jun Omae, 10 years ago

Owner: set to Jun Omae
Status: newassigned

I reconsider it. I think we should backport [12048] for #11283 to 0.12-stable. Also, the use of PermissionError in intertrac.py leads glitch of th:PermRedirectPlugin.

comment:4 by Jun Omae, 10 years ago

Release Notes: modified (diff)
Resolution: fixed
Status: assignedclosed

Backported in [12680]

Note: See TracTickets for help on using tickets.