# HG changeset patch
# User Pascal Volk <neverseen@users.sourceforge.net>
# Date 1250562555 0
# Node ID e671210b04b8a10c641806dd75e7a02fe14bee2b
# Parent  e35755191ff3c216d9ee446a2be4a6f660067e45
Fixed a libpq.OperationalError in Account.delete()
Passing only the object's address string to the 'alias delete' query, not the
whole EmailAddress object.

diff -r e35755191ff3 -r e671210b04b8 VirtualMailManager/Account.py
--- a/VirtualMailManager/Account.py	Mon Aug 17 06:31:14 2009 +0000
+++ b/VirtualMailManager/Account.py	Tue Aug 18 02:29:15 2009 +0000
@@ -221,7 +221,8 @@
             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)
+            dbc.execute("DELETE FROM alias WHERE destination = %s",
+                    str(self._addr))
             if u_rc > 0 or dbc.rowcount > 0:
                 self._dbh.commit()
         else: # check first for aliases