[master][PATCH] Check the password when Done is clicked (#948165)

Vratislav Podzimek vpodzime at redhat.com
Tue Jun 25 13:23:36 UTC 2013


This is just a copy-paste of the changes done in the commit
7a5f9ec5d122a42b2e55ff4d6587fdf821dbb264 for the user creation spoke.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/ui/gui/spokes/password.py | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/pyanaconda/ui/gui/spokes/password.py b/pyanaconda/ui/gui/spokes/password.py
index 2c877d2..1d882cf 100644
--- a/pyanaconda/ui/gui/spokes/password.py
+++ b/pyanaconda/ui/gui/spokes/password.py
@@ -158,6 +158,9 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke):
         if self._error:
             self.set_warning(self._error)
             self.window.show_all()
+            return False
+
+        return True
 
     def _validatePassword(self):
         # Do various steps to validate the password
@@ -189,6 +192,14 @@ class PasswordSpoke(FirstbootSpokeMixIn, NormalSpoke):
         if self._error:
             return False
 
+        # the self._checkPassword function is used to indicate the password
+        # strength and need of hitting the Done button twice so use it here as
+        # well
+        if not self._checkPassword() and pw != self._oldweak:
+            # check failed and the Done button was clicked for the first time
+            self._oldweak = pw
+            return False
+
         # if no errors, clear the info for next time we go into the spoke
         self._password = pw
         self.clear_info()
-- 
1.7.11.7



More information about the anaconda-patches mailing list