VMM: Fixed an AttributeError, caused by the last commit.
authorPascal Volk <neverseen@users.sourceforge.net>
Fri, 14 Aug 2009 06:16:01 +0000
changeset 109 766299a8639d
parent 108 fb88585f17fe
child 110 cb8b2f6a5fca
VMM: Fixed an AttributeError, caused by the last commit. Class EmailAddress has no __dict__ anymore.
VirtualMailManager/VirtualMailManager.py
--- a/VirtualMailManager/VirtualMailManager.py	Thu Aug 13 23:24:51 2009 +0000
+++ b/VirtualMailManager/VirtualMailManager.py	Fri Aug 14 06:16:01 2009 +0000
@@ -181,22 +181,22 @@
 
     def accountExists(dbh, address):
         sql = "SELECT gid FROM users WHERE gid = (SELECT gid FROM domain_name\
- WHERE domainname = '%(_domainname)s') AND local_part = '%(_localpart)s'" %\
-            address.__dict__
+ WHERE domainname = '%s') AND local_part = '%s'" % (address._domainname,
+            address._localpart)
         return VirtualMailManager._exists(dbh, sql)
     accountExists = staticmethod(accountExists)
 
     def aliasExists(dbh, address):
         sql = "SELECT DISTINCT gid FROM alias WHERE gid = (SELECT gid FROM\
- domain_name WHERE domainname = '%(_domainname)s') AND address =\
- '%(_localpart)s'" % address.__dict__
+ domain_name WHERE domainname = '%s') AND address = '%s'" %\
+            (address._domainname, address._localpart)
         return VirtualMailManager._exists(dbh, sql)
     aliasExists = staticmethod(aliasExists)
 
     def relocatedExists(dbh, address):
         sql = "SELECT gid FROM relocated WHERE gid = (SELECT gid FROM\
- domain_name WHERE domainname = '%(_domainname)s') AND address =\
- '%(_localpart)s'" % address.__dict__
+ domain_name WHERE domainname = '%s') AND address = '%s'" %\
+            (address._domainname, address._localpart)
         return VirtualMailManager._exists(dbh, sql)
     relocatedExists = staticmethod(relocatedExists)