# HG changeset patch # User Pascal Volk # Date 1402247315 0 # Node ID 8931c6b8435eb4e75d9b027f176b72485539f08e # Parent bc796a554ca2e2b6b463de8bfd7a507e08c63f59 VMM/handler: Handler.user_delete() Added parameter `delete_home'. diff -r bc796a554ca2 -r 8931c6b8435e 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: