mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
user-undel: Fix error messages.
https://fedorahosted.org/freeipa/ticket/5207 Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
parent
3692a1c57f
commit
65b8c62207
@ -827,16 +827,14 @@ class user_undel(LDAPQuery):
|
||||
|
||||
# First check that the user exists and is a delete one
|
||||
delete_dn = self.obj.get_either_dn(*keys, **options)
|
||||
if delete_dn.endswith(DN(self.obj.active_container_dn, api.env.basedn)):
|
||||
raise errors.ValidationError(
|
||||
name=self.obj.primary_key.cli_name,
|
||||
error=_('User %r is already active') % keys[-1][0])
|
||||
try:
|
||||
entry_attrs = self._exc_wrapper(keys, options, ldap.get_entry)(delete_dn)
|
||||
except errors.NotFound:
|
||||
raise errors.ValidationError(
|
||||
name=self.obj.primary_key.cli_name,
|
||||
error=_('User %r not found') % keys[-1][0])
|
||||
self.obj.handle_not_found(*keys)
|
||||
if delete_dn.endswith(DN(self.obj.active_container_dn,
|
||||
api.env.basedn)):
|
||||
raise errors.InvocationError(
|
||||
message=_('user "%s" is already active') % keys[-1])
|
||||
|
||||
active_dn = DN(delete_dn[0], self.obj.active_container_dn, api.env.basedn)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user