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): 
    200200
    201201    def _new_owner(self, ticket):
    202202        """Determines the new owner"""
    203         db = self.env.get_db_cnx()
     203        db = self.env.get_read_db()
    204204        cursor = db.cursor()
    205205        cursor.execute("SELECT oldvalue FROM ticket_change WHERE ticket=%s " \
    206206                       "AND field='owner' ORDER BY -time", (ticket.id, ))
    class TicketWorkflowOpStatusPrevious(TicketWorkflowOpBase): 
    248248
    249249    def _new_status(self, ticket):
    250250        """Determines the new status"""
    251         db = self.env.get_db_cnx()
     251        db = self.env.get_read_db()
    252252        cursor = db.cursor()
    253253        cursor.execute("SELECT oldvalue FROM ticket_change WHERE ticket=%s " \
    254254                       "AND field='status' ORDER BY -time", (ticket.id, ))

Attachments (0)

Change History (1)

comment:1 Changed 8 years ago by Jun Omae

Resolution: fixed
Status: newclosed

In 16304:

AdvancedTicketWorkflowPlugin/0.12: use Environment.get_read_db() rather than .get_db_cnx() (closes #13101)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain Eli Carter.
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.