[PATCH] Fix display of weak password warning (#1011850)

David Shea dshea at redhat.com
Thu Sep 26 20:44:05 UTC 2013


Only display the error message from libpwquality if one has been set.
---
 pyanaconda/ui/gui/spokes/user.py | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/user.py b/pyanaconda/ui/gui/spokes/user.py
index 39f7c42..aca7d95 100644
--- a/pyanaconda/ui/gui/spokes/user.py
+++ b/pyanaconda/ui/gui/spokes/user.py
@@ -548,8 +548,12 @@ class UserSpoke(FirstbootSpokeMixIn, NormalSpoke):
             if self._waivePasswordClicks > 1:
                 return None
             elif self._waivePasswordClicks == 1:
-                return _("You have provided a weak password: %s. "
-                        " Press Done again to use anyway.") % self._pwq_error
+                if self._pwq_error:
+                    return _("You have provided a weak password: %s. "
+                            " Press Done again to use anyway.") % self._pwq_error
+                else:
+                    return _("You have provided a weak password. "
+                            " Press Done again to use anyway.")
             else:
                 error = _("The password you have provided is weak")
                 if self._pwq_error:
-- 
1.8.3.1



More information about the anaconda-patches mailing list