VirtualMailManager/handler.py
branchv0.6.x
changeset 341 6709d0faf2f5
parent 337 150ddcc8b315
child 351 4bba5fb90b78
equal deleted inserted replaced
340:4515afec62e5 341:6709d0faf2f5
   198         Raises a `VMMError` if the address is known.
   198         Raises a `VMMError` if the address is known.
   199         """
   199         """
   200         other = self._chk_other_address_types(address, exclude)
   200         other = self._chk_other_address_types(address, exclude)
   201         if not other:
   201         if not other:
   202             return False
   202             return False
       
   203         # TP: %(a_type)s will be one of: 'an account', 'an alias' or
       
   204         # 'a relocated user'
   203         msg = _(u"There is already %(a_type)s with the address '%(address)s'.")
   205         msg = _(u"There is already %(a_type)s with the address '%(address)s'.")
   204         raise VMMError(msg % {'a_type': OTHER_TYPES[other][0],
   206         raise VMMError(msg % {'a_type': OTHER_TYPES[other][0],
   205                               'address': address}, OTHER_TYPES[other][1])
   207                               'address': address}, OTHER_TYPES[other][1])
   206 
   208 
   207     def _get_account(self, address):
   209     def _get_account(self, address):
   422         """Wrapper around Domain.get_info(), Domain.get_accounts(),
   424         """Wrapper around Domain.get_info(), Domain.get_accounts(),
   423         Domain.get_aliase_names(), Domain.get_aliases() and
   425         Domain.get_aliase_names(), Domain.get_aliases() and
   424         Domain.get_relocated."""
   426         Domain.get_relocated."""
   425         if details not in [None, 'accounts', 'aliasdomains', 'aliases', 'full',
   427         if details not in [None, 'accounts', 'aliasdomains', 'aliases', 'full',
   426                            'relocated']:
   428                            'relocated']:
   427             raise VMMError(_(u'Invalid argument: ā€œ%sā€') % details,
   429             raise VMMError(_(u"Invalid argument: '%s'") % details,
   428                            INVALID_ARGUMENT)
   430                            INVALID_ARGUMENT)
   429         dom = self._get_domain(domainname)
   431         dom = self._get_domain(domainname)
   430         dominfo = dom.get_info()
   432         dominfo = dom.get_info()
   431         if dominfo['domainname'].startswith('xn--'):
   433         if dominfo['domainname'].startswith('xn--'):
   432             dominfo['domainname'] += ' (%s)' % \
   434             dominfo['domainname'] += ' (%s)' % \