From: Frank Brehm Date: Tue, 30 May 2023 13:37:01 +0000 (+0200) Subject: Fixing logic gap because of removing or deactivating an user. X-Git-Tag: 0.8.8~1^2~1 X-Git-Url: https://git.uhu-banane.net/?a=commitdiff_plain;h=ffc3921f80f58cfca8c82a44750fe43d819d4be6;p=pixelpark%2Fpp-admin-tools.git Fixing logic gap because of removing or deactivating an user. --- diff --git a/lib/pp_admintools/app/remove_ldap_user.py b/lib/pp_admintools/app/remove_ldap_user.py index 87ca98e..e1a3d93 100644 --- a/lib/pp_admintools/app/remove_ldap_user.py +++ b/lib/pp_admintools/app/remove_ldap_user.py @@ -25,7 +25,7 @@ from ..xlate import XLATOR from .ldap import LdapAppError, FatalLDAPError from .ldap import BaseLdapApplication -__version__ = '0.5.8' +__version__ = '0.5.9' LOG = logging.getLogger(__name__) _ = XLATOR.gettext @@ -130,7 +130,7 @@ class RemoveLdapUserApplication(BaseLdapApplication): if not self.deactivate: help_txt += help_default remove_mode_group.add_argument( - '-R', '--remove', dest="deactivate", action='store_false', help=help_txt) + '-R', '--remove', dest="remove", action='store_true', help=help_txt) remove_group.add_argument( 'users', nargs='*', metavar=_('USER'), @@ -161,7 +161,10 @@ class RemoveLdapUserApplication(BaseLdapApplication): LOG.error(_("No users to remove given.")) self.exit(1) - self.deactivate = getattr(self.args, 'deactivate', False) + deactivate = bool(getattr(self.args, 'remove', False)) + remove = bool(getattr(self.args, 'remove', False)) + if remove: + self.deactivate = False self.given_users = given_users