Modify

Opened 4 years ago

Closed 3 years ago

#8909 closed enhancement (fixed)

needs updates for 0.13dev

Reported by: jayen Owned by: bobbysmith007
Priority: normal Component: NeverNotifyUpdaterPlugin
Severity: normal Keywords:
Cc: Trac Release: 0.12

Description

this is a patch my friend sent me:

Index: 0.12/nevernotifyupdaterplugin/api.py
===================================================================
--- 0.12/nevernotifyupdaterplugin/api.py        (revision 10321)
+++ 0.12/nevernotifyupdaterplugin/api.py        (working copy)
@@ -28,20 +28,21 @@
         domain = ''
         if defaultDomain: domain = '@'+defaultDomain

-        cursor = self.db.cursor()
-        # Suppress the updater from the recipients
-        updater = None
-        up_em = None
-        cursor.execute("SELECT author FROM ticket_change WHERE ticket=%s "
-                       "ORDER BY time DESC LIMIT 1", (tktid,))
-        for updater, in cursor: break
-        else:
-          cursor.execute("SELECT reporter FROM ticket WHERE id=%s",
-                         (tktid,))
-          for updater, in cursor: break
+        with self.env.db_query as db:
+            cursor = db.cursor()
+            # Suppress the updater from the recipients
+            updater = None
+            up_em = None
+            cursor.execute("SELECT author FROM ticket_change WHERE ticket=%s "
+                           "ORDER BY time DESC LIMIT 1", (tktid,))
+            for updater, in cursor: break
+            else:
+              cursor.execute("SELECT reporter FROM ticket WHERE id=%s",
+                             (tktid,))
+              for updater, in cursor: break

-        cursor.execute("SELECT value FROM session_attribute WHERE name='email' and sid=%s;",(updater,))
-        for up_em, in cursor: break
+            cursor.execute("SELECT value FROM session_attribute WHERE name='email' and sid=%s;",(updater,))
+            for up_em, in cursor: break

         def finder(r):
           if not r:

Attachments (0)

Change History (4)

comment:1 Changed 3 years ago by bobbysmith007

sorry for the delayed response, I didnt see this ticket

Thanks for the patch, I will get it pushed up in a minute

comment:2 follow-up: Changed 3 years ago by bobbysmith007

  • Resolution set to fixed
  • Status changed from new to closed

I think i got it all applied correctly, please let me know if you have more troubles. I am still running trac12

http://trac-hacks.org/browser/nevernotifyupdaterplugin/0.13

comment:3 in reply to: ↑ 2 Changed 3 years ago by chung.bui.foss@…

  • Resolution fixed deleted
  • Status changed from closed to reopened

Replying to bobbysmith007:

I think i got it all applied correctly, please let me know if you have more troubles. I am still running trac12

http://trac-hacks.org/browser/nevernotifyupdaterplugin/0.13

Dear bobbysmith007, I think the latest revision of the plugin nevernotifyupdater contains an error in line 35, from "self" is not necessary. Please please revise and update patches

comment:4 Changed 3 years ago by bobbysmith007

  • Resolution set to fixed
  • Status changed from reopened to closed

(In [10745]) removed extra self (thanks! for the bug report) fix #8909

Add Comment

Modify Ticket

Action
as closed The owner will remain bobbysmith007.
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.