VirtualMailManager/alias.py
branchv0.6.x
changeset 352 22d115376e4d
parent 322 94bd10e237e5
child 366 d6573da35b5f
--- a/VirtualMailManager/alias.py	Sat Aug 07 05:16:26 2010 +0000
+++ b/VirtualMailManager/alias.py	Sat Aug 07 20:01:19 2010 +0000
@@ -41,7 +41,7 @@
         """Loads all known destination addresses into the _dests list."""
         dbc = self._dbh.cursor()
         dbc.execute('SELECT destination FROM alias WHERE gid = %s AND '
-                    'address = %s', self._gid, self._addr.localpart)
+                    'address = %s', (self._gid, self._addr.localpart))
         dests = dbc.fetchall()
         if dbc.rowcount > 0:
             self._dests.extend(EmailAddress(dest[0]) for dest in dests)
@@ -81,11 +81,11 @@
         dbc = self._dbh.cursor()
         if not destination:
             dbc.execute('DELETE FROM alias WHERE gid = %s AND address = %s',
-                        self._gid, self._addr.localpart)
+                        (self._gid, self._addr.localpart))
         else:
             dbc.execute('DELETE FROM alias WHERE gid = %s AND address = %s '
-                        'AND destination = %s', self._gid,
-                        self._addr.localpart, str(destination))
+                        'AND destination = %s',
+                        (self._gid, self._addr.localpart, str(destination)))
         if dbc.rowcount > 0:
             self._dbh.commit()
         dbc.close()