VirtualMailManager/aliasdomain.py
branchv0.6.x
changeset 352 22d115376e4d
parent 320 011066435e6f
child 366 d6573da35b5f
--- a/VirtualMailManager/aliasdomain.py	Sat Aug 07 05:16:26 2010 +0000
+++ b/VirtualMailManager/aliasdomain.py	Sat Aug 07 20:01:19 2010 +0000
@@ -42,7 +42,7 @@
         domain name is marked as primary."""
         dbc = self._dbh.cursor()
         dbc.execute('SELECT gid, is_primary FROM domain_name WHERE '
-                    'domainname = %s', self._name)
+                    'domainname = %s', (self._name,))
         result = dbc.fetchone()
         dbc.close()
         if result:
@@ -76,7 +76,7 @@
                         self._domain.name, NO_SUCH_DOMAIN)
         dbc = self._dbh.cursor()
         dbc.execute('INSERT INTO domain_name VALUES (%s, %s, FALSE)',
-                    self._name, self._domain.gid)
+                    (self._name, self._domain.gid))
         self._dbh.commit()
         dbc.close()
         self._gid = self._domain.gid
@@ -89,7 +89,7 @@
                         self._name, NO_SUCH_ALIASDOMAIN)
         dbc = self._dbh.cursor()
         dbc.execute('SELECT domainname FROM domain_name WHERE gid = %s AND '
-                    'is_primary', self._gid)
+                    'is_primary', (self._gid,))
         domain = dbc.fetchone()
         dbc.close()
         if domain:
@@ -118,8 +118,8 @@
                         ALIASDOMAIN_EXISTS)
         dbc = self._dbh.cursor()
         dbc.execute('UPDATE domain_name SET gid = %s WHERE gid = %s AND '
-                    'domainname = %s AND NOT is_primary', self._domain.gid,
-                    self._gid, self._name)
+                    'domainname = %s AND NOT is_primary', (self._domain.gid,
+                    self._gid, self._name))
         self._dbh.commit()
         dbc.close()
         self._gid = self._domain.gid
@@ -134,7 +134,7 @@
                         self._name, NO_SUCH_ALIASDOMAIN)
         dbc = self._dbh.cursor()
         dbc.execute('DELETE FROM domain_name WHERE domainname = %s AND NOT '
-                    'is_primary', self._name)
+                    'is_primary', (self._name,))
         if dbc.rowcount > 0:
             self._dbh.commit()
             self._gid = 0