VirtualMailManager/handler.py
branchv0.6.x
changeset 331 270b57af85de
parent 330 3fe8d6cdbe3a
child 333 1ed85e696748
equal deleted inserted replaced
330:3fe8d6cdbe3a 331:270b57af85de
   387         if force is None:
   387         if force is None:
   388             dom.update_transport(trsp)
   388             dom.update_transport(trsp)
   389         else:
   389         else:
   390             dom.update_transport(trsp, force=True)
   390             dom.update_transport(trsp, force=True)
   391 
   391 
   392     def domain_delete(self, domainname, force=None):
   392     def domain_delete(self, domainname, force=False):
   393         """Wrapper around Domain.delete()"""
   393         """Wrapper around Domain.delete()"""
   394         if force and force not in ('deluser', 'delalias', 'delall'):
   394         if not isinstance(force, bool):
   395             raise DomainError(_(u"Invalid argument: '%s'") % force,
   395             raise TypeError('force must be a bool')
   396                               INVALID_ARGUMENT)
       
   397         dom = self._get_domain(domainname)
   396         dom = self._get_domain(domainname)
   398         gid = dom.gid
   397         gid = dom.gid
   399         domdir = dom.directory
   398         domdir = dom.directory
   400         if self._cfg.dget('domain.force_deletion') or force == 'delall':
   399         if self._cfg.dget('domain.force_deletion') or force:
   401             dom.delete(True, True)
   400             dom.delete(True)
   402         elif force == 'deluser':
       
   403             dom.delete(deluser=True)
       
   404         elif force == 'delalias':
       
   405             dom.delete(delalias=True)
       
   406         else:
   401         else:
   407             dom.delete()
   402             dom.delete(False)
   408         if self._cfg.dget('domain.delete_directory'):
   403         if self._cfg.dget('domain.delete_directory'):
   409             self._delete_domain_dir(domdir, gid)
   404             self._delete_domain_dir(domdir, gid)
   410 
   405 
   411     def domain_info(self, domainname, details=None):
   406     def domain_info(self, domainname, details=None):
   412         """Wrapper around Domain.get_info(), Domain.get_accounts(),
   407         """Wrapper around Domain.get_info(), Domain.get_accounts(),