VMM/handler: Handler._get_{account,alias,relocated}() check v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Mon, 17 Jan 2011 19:44:36 +0000
branchv0.6.x
changeset 372 ef99be5b7ec0
parent 371 3b2fd0b4e51b
child 373 1016a17684c1
VMM/handler: Handler._get_{account,alias,relocated}() check if the address is already in use.
VirtualMailManager/handler.py
--- a/VirtualMailManager/handler.py	Mon Jan 17 19:08:18 2011 +0000
+++ b/VirtualMailManager/handler.py	Mon Jan 17 19:44:36 2011 +0000
@@ -246,18 +246,21 @@
         """Return an Account instances for the given address (str)."""
         address = EmailAddress(address)
         self._db_connect()
+        self._is_other_address(address, TYPE_ACCOUNT)
         return Account(self._dbh, address)
 
     def _get_alias(self, address):
         """Return an Alias instances for the given address (str)."""
         address = EmailAddress(address)
         self._db_connect()
+        self._is_other_address(address, TYPE_ALIAS)
         return Alias(self._dbh, address)
 
     def _get_relocated(self, address):
         """Return a Relocated instances for the given address (str)."""
         address = EmailAddress(address)
         self._db_connect()
+        self._is_other_address(address, TYPE_RELOCATED)
         return Relocated(self._dbh, address)
 
     def _get_domain(self, domainname):