mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
user: do not assume the preserve flags have value in user_del
https://fedorahosted.org/freeipa/ticket/4739 Reviewed-By: David Kupka <dkupka@redhat.com>
This commit is contained in:
parent
3eaafe42b5
commit
213237c7fe
@ -674,14 +674,15 @@ class user_del(baseuser_del):
|
||||
|
||||
def forward(self, *keys, **options):
|
||||
if self.api.env.context == 'cli':
|
||||
if options['no_preserve'] and options['preserve']:
|
||||
no_preserve = options.pop('no_preserve', False)
|
||||
preserve = options.pop('preserve', False)
|
||||
if no_preserve and preserve:
|
||||
raise errors.MutuallyExclusiveError(
|
||||
reason=_("preserve and no-preserve cannot be both set"))
|
||||
elif options['no_preserve']:
|
||||
elif no_preserve:
|
||||
options['preserve'] = False
|
||||
elif not options['preserve']:
|
||||
del options['preserve']
|
||||
del options['no_preserve']
|
||||
elif preserve:
|
||||
options['preserve'] = True
|
||||
|
||||
return super(user_del, self).forward(*keys, **options)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user