VirtualMailManager/relocated.py
branchv0.6.x
changeset 352 22d115376e4d
parent 341 6709d0faf2f5
child 366 d6573da35b5f
--- a/VirtualMailManager/relocated.py	Sat Aug 07 05:16:26 2010 +0000
+++ b/VirtualMailManager/relocated.py	Sat Aug 07 20:01:19 2010 +0000
@@ -52,7 +52,7 @@
         """
         dbc = self._dbh.cursor()
         dbc.execute('SELECT destination FROM relocated WHERE gid = %s AND '
-                    'address = %s', self._gid, self._addr.localpart)
+                    'address = %s', (self._gid, self._addr.localpart))
         destination = dbc.fetchone()
         dbc.close()
         if destination:
@@ -83,11 +83,11 @@
         dbc = self._dbh.cursor()
         if not update:
             dbc.execute('INSERT INTO relocated VALUES (%s, %s, %s)',
-                        self._gid, self._addr.localpart, str(self._dest))
+                        (self._gid, self._addr.localpart, str(self._dest)))
         else:
             dbc.execute('UPDATE relocated SET destination = %s WHERE gid = %s '
-                        'AND address = %s', str(self._dest), self._gid,
-                        self._addr.localpart)
+                        'AND address = %s',
+                        (str(self._dest), self._gid, self._addr.localpart))
         self._dbh.commit()
         dbc.close()
 
@@ -105,7 +105,7 @@
                        self._addr, NO_SUCH_RELOCATED)
         dbc = self._dbh.cursor()
         dbc.execute('DELETE FROM relocated WHERE gid = %s AND address = %s',
-                    self._gid, self._addr.localpart)
+                    (self._gid, self._addr.localpart))
         if dbc.rowcount > 0:
             self._dbh.commit()
         dbc.close()