Edgewall Software

Opened 6 years ago

Closed 6 years ago

#12837 closed defect (fixed)

Poor PermissionError message when resource.id is None

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:

Fixed poor error message when resource id is empty or None.

API Changes:
Internal Changes:



  • /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):  
    5151        self.resource = resource
    5252        self.env = env
    5353        if self.action:
    54             if self.resource:
     54            if self.resource and self.resource.id:
    5555                msg = _("%(perm)s privileges are required to perform "
    5656                        "this operation on %(resource)s. You don't have the "
    5757                        "required permissions.",

Attachments (0)

Change History (1)

comment:1 by Ryan J Ollos, 6 years ago

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

Committed to 1.2-stable in r16022, merged to trunk in r16023.

Modify Ticket

Change Properties
Set your email in Preferences
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from Ryan J Ollos to the specified user.

Add Comment

E-mail address and name can be saved in the Preferences .
Note: See TracTickets for help on using tickets.