590d18
From 5fb2c0f8c7237214f870d341cc10a2ccda48d117 Mon Sep 17 00:00:00 2001
590d18
From: Martin Basti <mbasti@redhat.com>
590d18
Date: Fri, 10 Jul 2015 14:47:59 +0200
590d18
Subject: [PATCH] Stageusedr-activate: show username instead of DN
590d18
590d18
If activate user already exists, show name of this user in error message
590d18
instead of user DN.
590d18
Error message reworder to keep the same format as stageuser-add,
590d18
user-add.
590d18
590d18
https://fedorahosted.org/freeipa/ticket/5038
590d18
590d18
Reviewed-By: David Kupka <dkupka@redhat.com>
590d18
---
590d18
 ipalib/plugins/stageuser.py | 5 +++--
590d18
 1 file changed, 3 insertions(+), 2 deletions(-)
590d18
590d18
diff --git a/ipalib/plugins/stageuser.py b/ipalib/plugins/stageuser.py
590d18
index 35e636ded4474b00ad635c60340aaf66e6b41752..6cbc8f4ab07f2c1172f2b2c45bfe8f30a74938b3 100644
590d18
--- a/ipalib/plugins/stageuser.py
590d18
+++ b/ipalib/plugins/stageuser.py
590d18
@@ -682,8 +682,9 @@ class stageuser_activate(LDAPQuery):
590d18
                 active_dn, ['dn']
590d18
             )
590d18
             assert isinstance(staging_dn, DN)
590d18
-            raise errors.DuplicateEntry(message=_('Active user %(user)s already exists') % dict(
590d18
-                            user=test_entry_attrs.dn))
590d18
+            raise errors.DuplicateEntry(
590d18
+                message=_('active user with name "%(user)s" already exists') %
590d18
+                dict(user=args[-1]))
590d18
         except errors.NotFound:
590d18
             pass
590d18
 
590d18
-- 
590d18
2.1.0
590d18