Modify

Opened 13 years ago

Closed 12 years ago

Last modified 12 years ago

#9154 closed defect (duplicate)

ticket deletion error

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

Description (last modified by Ryan J Ollos)

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 13 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 13 years ago by Ryan J Ollos

Description: modified (diff)
Owner: changed from Robert Corsaro to Ryan J Ollos
Status: newassigned

comment:3 Changed 12 years ago by Ryan J Ollos

Resolution: duplicate
Status: assignedclosed

Duplicate of #8577.

comment:4 Changed 12 years ago by Ryan J Ollos

Description: modified (diff)

comment:5 Changed 12 years ago by Steffen Hoffmann

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

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Ryan J Ollos.
The resolution will be deleted. Next status will be 'reopened'.

Add Comment


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

 
Note: See TracTickets for help on using tickets.