VMM/handler: Handler.user_delete() Added parameter `delete_home'. v0.7.x
authorPascal Volk <user@localhost.localdomain.org>
Sun, 08 Jun 2014 17:08:35 +0000
branchv0.7.x
changeset 750 8931c6b8435e
parent 749 bc796a554ca2
child 751 9d739cd2f527
VMM/handler: Handler.user_delete() Added parameter `delete_home'.
VirtualMailManager/handler.py
--- a/VirtualMailManager/handler.py	Sun Jun 08 14:03:07 2014 +0000
+++ b/VirtualMailManager/handler.py	Sun Jun 08 17:08:35 2014 +0000
@@ -624,8 +624,10 @@
                 self._warnings.append(_("The destination account/alias '%s' "
                                         "does not exist.") % destination)
 
-    def user_delete(self, emailaddress, force=False):
+    def user_delete(self, emailaddress, delete_home, force=False):
         """Wrapper around Account.delete(...)"""
+        if not isinstance(delete_home, bool):
+            raise TypeError('delete_home must be a bool')
         if not isinstance(force, bool):
             raise TypeError('force must be a bool')
         acc = self._get_account(emailaddress)
@@ -637,7 +639,7 @@
         dom_dir = acc.domain.directory
         acc_dir = acc.home
         acc.delete(force)
-        if self._cfg.dget('account.delete_directory'):
+        if delete_home or self._cfg.dget('account.delete_directory'):
             try:
                 self._delete_home(dom_dir, uid, gid)
             except VMMError as err: