Modify

Opened 3 years ago

Closed 22 months ago

Last modified 21 months ago

#9154 closed defect (duplicate)

ticket deletion error

Reported by: sb@… Owned by: rjollos
Priority: normal Component: AnnouncerPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description (last modified by rjollos)

Error while deleting ticket:

Traceback (most recent call last):
  File "build/bdist.freebsd-8.2-STABLE-amd64/egg/trac/admin/console.py", line 107, in onecmd
    rv = cmd.Cmd.onecmd(self, line) or 0
  File "/usr/local/lib/python2.6/cmd.py", line 218, in onecmd
    return self.default(line)
  File "build/bdist.freebsd-8.2-STABLE-amd64/egg/trac/admin/console.py", line 266, in default
    return cmd_mgr.execute_command(*args)
  File "build/bdist.freebsd-8.2-STABLE-amd64/egg/trac/admin/api.py", line 123, in execute_command
    return f(*fargs)
  File "build/bdist.freebsd-8.2-STABLE-amd64/egg/trac/ticket/admin.py", line 838, in _do_remove
    @self.env.with_transaction()
  File "build/bdist.freebsd-8.2-STABLE-amd64/egg/trac/db/api.py", line 77, in transaction_wrapper
    fn(ldb)
  File "build/bdist.freebsd-8.2-STABLE-amd64/egg/trac/ticket/admin.py", line 841, in do_remove
    ticket.delete()
  File "build/bdist.freebsd-8.2-STABLE-amd64/egg/trac/ticket/model.py", line 421, in delete
    listener.ticket_deleted(self)
  File "build/bdist.freebsd-8.2-STABLE-amd64/egg/announcer/subscribers.py", line 844, in ticket_deleted
    self.env, klass, 'ticket', page.name)
NameError: global name 'page' is not defined

caused by typo in WatchSubscriber.ticket_deleted.

Fix:

  • subscribers.py

    old new  
    841841    def ticket_deleted(self, ticket): 
    842842        klass = self.__class__.__name__ 
    843843        SubscriptionAttribute.delete_by_class_realm_and_target( 
    844                 self.env, klass, 'ticket', page.name) 
     844                self.env, klass, 'ticket', ticket.name) 
    845845        db = self.env.get_db_cnx() 
    846846 
    847847    def matches(self, event): 

Attachments (0)

Change History (5)

comment:1 Changed 3 years ago by sb@…

Correct patch actually looks like:

@@ -841,7 +841,7 @@
     def ticket_deleted(self, ticket):
         klass = self.__class__.__name__
         SubscriptionAttribute.delete_by_class_realm_and_target(
-                self.env, klass, 'ticket', page.name)
+                self.env, klass, 'ticket', self._get_target_id(ticket))
         db = self.env.get_db_cnx()
 
     def matches(self, event):

comment:2 Changed 2 years ago by rjollos

  • Description modified (diff)
  • Owner changed from doki_pen to rjollos
  • Status changed from new to assigned

comment:3 Changed 22 months ago by rjollos

  • Resolution set to duplicate
  • Status changed from assigned to closed

comment:4 Changed 22 months ago by rjollos

  • Description modified (diff)

comment:5 Changed 21 months ago by hasienda

(In [12304]) TracAnnouncer: Correctly convert id for ticket resources, refs #8065 and #9154.

Add Comment

Modify Ticket

Action
as closed .
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from rjollos. Next status will be 'closed'.
The resolution will be deleted. Next status will be 'reopened'.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.