#11511 closed defect (fixed)
Strange message for intertrac without link
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: Improved error message for an intertrac link to a non-existent or forbidden changeset. |
||
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): 53 53 if isinstance(link_frag, (Element, Fragment)): 54 54 elt = find_element(link_frag, 'href') 55 55 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)) 57 57 href = elt.attrib.get('href') 58 58 else: 59 59 href = req.href(link.rstrip(':'))
Attachments (0)
Change History (7)
comment:1 by , 11 years ago
comment:2 by , 11 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.
follow-up: 5 comment:3 by , 11 years ago
Owner: | set to |
---|---|
Status: | new → assigned |
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 , 11 years ago
Release Notes: | modified (diff) |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Backported in [12680]
follow-up: 6 comment:5 by , 11 years ago
Replying to jomae:
Also, the use of
PermissionError
in intertrac.py leads glitch of th:PermRedirectPlugin.
th:PermRedirectPlugin appear to redirect on PermissionError
(th:browser:permredirectplugin/trunk/permredirect/filter.py@12446:66#L64), but that seems expected. What issue were you seeing?
edit: Looking at this more closely now, maybe we don't want it to redirect since it may be a case of the resource not being found.
comment:6 by , 11 years ago
Replying to rjollos:
edit: Looking at this more closely now, maybe we don't want it to redirect since it may be a case of the resource not being found.
Yes, you're right.
Before [12680] and [12048], Trac raises a PermissionError
for non-existent resource in intertrac and the plugin redirect to login page. But Trac raises NotFound
for the non-existent resource after logged in.
I think the behavior confuses the users.
comment:7 by , 10 years ago
Release Notes: | modified (diff) |
---|
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.