VirtualMailManager/Relocated.py
branchv0.6.x
changeset 222 d0c16e70a9fb
parent 216 0c8c053b451c
child 249 bb7d9906c529
--- a/VirtualMailManager/Relocated.py	Sat Feb 27 21:36:55 2010 +0000
+++ b/VirtualMailManager/Relocated.py	Sun Feb 28 20:51:34 2010 +0000
@@ -11,7 +11,7 @@
 from VirtualMailManager.Domain import get_gid
 from VirtualMailManager.EmailAddress import EmailAddress
 from VirtualMailManager.errors import RelocatedError as RErr
-from VirtualMailManager.constants.ERROR import \
+from VirtualMailManager.constants.ERROR import NO_SUCH_DOMAIN, \
      NO_SUCH_RELOCATED, RELOCATED_ADDR_DEST_IDENTICAL, RELOCATED_EXISTS
 
 
@@ -34,6 +34,9 @@
         self._addr = address
         self._dbh = dbh
         self._gid = get_gid(self._dbh, self._addr.domainname)
+        if not self._gid:
+            raise RErr(_(u"The domain %r doesn't exist.") %
+                       self._addr.domainname, NO_SUCH_DOMAIN)
         self._dest = None
 
         self.__load()