#5652 closed defect (fixed)
update fails after plugin is installed when using postgres backend
Reported by: | Owned by: | Colin Guthrie | |
---|---|---|---|
Priority: | normal | Component: | ClientsPlugin |
Severity: | critical | Keywords: | |
Cc: | Trac Release: | 0.11 |
Description
There is a problem in the code in api.py that prevents a successful update.
Postgres does not accept double quoted values as literals hence the section 'v5' needs to be updated using escaped single quotes.
Below is the corrected code (I have not tested this with anything other than postgres but it should work fine):
cursor.execute('INSERT INTO client_events '
'SELECT \'Weekly Summary\', \'Milestone Summary\', \'Send Email\', MAX(summary_lastupdate) ' 'FROM client')
cursor.execute('INSERT INTO client_event_action_options '
'SELECT \'Weekly Summary\', name, \'Email Addresses\', summary_list ' 'FROM client ' 'WHERE summary_list!=\'\)
cursor.execute('INSERT INTO client_events '
'SELECT \'Ticket Changes\', \'Ticket Change Summary\', \'Send Email\', MAX(changes_lastupdate) ' 'FROM client')
cursor.execute('INSERT INTO client_event_action_options '
'SELECT \'Ticket Changes\', name, \'Email Addresses\', changes_list ' 'FROM client ' 'WHERE changes_list!=\'\)
(In [6473]) Hopefully fix some postgres issues.
Closes #5652, Refs #4805