Opened 7 years ago
Last modified 7 years ago
#12837 closed defect
Poor PermissionError message when resource.id is None — at Initial Version
Reported by: | Ryan J Ollos | Owned by: | Ryan J Ollos |
---|---|---|---|
Priority: | normal | Milestone: | 1.2.2 |
Component: | general | Version: | |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
Examples:
/timeline
: TIMELINE_VIEW privileges are required to perform this operation on timeline:None. You don't have the required permissions./newticket
: TICKET_CREATE privileges are required to perform this operation on Ticket #None. You don't have the required permissions.
Proposed fix:
-
trac/perm.py
diff --git a/trac/perm.py b/trac/perm.py index b309a00f0..6f9405682 100644
a b class PermissionError(StandardError, TracBaseError): 51 51 self.resource = resource 52 52 self.env = env 53 53 if self.action: 54 if self.resource :54 if self.resource and self.resource.id: 55 55 msg = _("%(perm)s privileges are required to perform " 56 56 "this operation on %(resource)s. You don't have the " 57 57 "required permissions.",
Note:
See TracTickets
for help on using tickets.