* 'VirtualMailManager/Account.py'
authorPascal Volk <neverseen@users.sourceforge.net>
Mon, 25 Aug 2008 14:49:43 +0000
changeset 65 5506433db9a3
parent 64 432a037658a8
child 66 995d538a6eb5
* 'VirtualMailManager/Account.py' - Account.delete() delete also all aliases where the destination address is the same as for this account.
VirtualMailManager/Account.py
--- a/VirtualMailManager/Account.py	Sun Aug 24 22:26:00 2008 +0000
+++ b/VirtualMailManager/Account.py	Mon Aug 25 14:49:43 2008 +0000
@@ -198,7 +198,11 @@
             dbc = self._dbh.cursor()
             dbc.execute("DELETE FROM users WHERE gid=%s AND local_part=%s",
                     self._gid, self._localpart)
-            if dbc.rowcount > 0:
+            u_rc = dbc.rowcount
+            # delete also all aliases where the destination address is the same
+            # as for this account.
+            dbc.execute("DELETE FROM alias WHERE destination = %s", self._addr)
+            if u_rc > 0 or dbc.rowcount > 0:
                 self._dbh.commit()
             dbc.close()
         else: