Modify ↓
Opened 8 years ago
Closed 8 years ago
#13101 closed defect (fixed)
For 0.12 branch, `Environment.get_read_db()` should be used rather than `.get_db_cnx()`
Reported by: | Jun Omae | Owned by: | Eli Carter |
---|---|---|---|
Priority: | normal | Component: | AdvancedTicketWorkflowPlugin |
Severity: | normal | Keywords: | |
Cc: | Trac Release: | 0.12 |
Description
AdvancedTicketWorkflowPlugin has 0.11, 0.12 and 1.2 branches. For 0.12 branch, we could use Environment.get_read_db()
rather than .get_db_cnx()
.
-
advancedworkflow/controller.py
diff --git a/advancedworkflow/controller.py b/advancedworkflow/controller.py index d8cac545b..5d5267ecf 100644
a b class TicketWorkflowOpOwnerPrevious(TicketWorkflowOpBase): 200 200 201 201 def _new_owner(self, ticket): 202 202 """Determines the new owner""" 203 db = self.env.get_ db_cnx()203 db = self.env.get_read_db() 204 204 cursor = db.cursor() 205 205 cursor.execute("SELECT oldvalue FROM ticket_change WHERE ticket=%s " \ 206 206 "AND field='owner' ORDER BY -time", (ticket.id, )) … … class TicketWorkflowOpStatusPrevious(TicketWorkflowOpBase): 248 248 249 249 def _new_status(self, ticket): 250 250 """Determines the new status""" 251 db = self.env.get_ db_cnx()251 db = self.env.get_read_db() 252 252 cursor = db.cursor() 253 253 cursor.execute("SELECT oldvalue FROM ticket_change WHERE ticket=%s " \ 254 254 "AND field='status' ORDER BY -time", (ticket.id, ))
Attachments (0)
Note: See
TracTickets for help on using
tickets.
In 16304: