VMM/serviceset: Fixed a conditional ProgrammingError.
authorPascal Volk <user@localhost.localdomain.org>
Mon, 27 Aug 2012 20:49:31 +0000
changeset 594 cdbe200c0ecc
parent 593 3dc1764c23d2
child 595 86b967c0f1a1
VMM/serviceset: Fixed a conditional ProgrammingError. Affects only setups with Dovecot < v1.2.beta2. Actually the SQL query in method ServiceSet._load_by_services wasn't updated. Removed unnecessary code, which would have also produced a ProgrammingError, if it would have been correct.
VirtualMailManager/serviceset.py
--- a/VirtualMailManager/serviceset.py	Thu Aug 23 21:27:33 2012 +0000
+++ b/VirtualMailManager/serviceset.py	Mon Aug 27 20:49:31 2012 +0000
@@ -109,7 +109,7 @@
                ' AND '.join('%s = %s' %
                (k, str(v).upper()) for k, v in self._services.iteritems()))
         if self._sieve_col == 'managesieve':
-            sql.replace('sieve', self._sieve_col)
+            sql = sql.replace('sieve', self._sieve_col)
         dbc = self._dbh.cursor()
         dbc.execute(sql)
         result = dbc.fetchone()
@@ -141,8 +141,6 @@
         sql = ('INSERT INTO service_set (ssid, smtp, pop3, imap, %s) ' %
                (self._sieve_col,) +
                'VALUES (%(ssid)s, %(smtp)s, %(pop3)s, %(imap)s, %(sieve)s)')
-        if self._sieve_col == 'managesieve':
-            sql.replace('sieve', self._sieve_col)
         self._set_ssid()
         values = {'ssid': self._ssid}
         values.update(self._services)