[Checkins] SVN: z3c.password/branches/adamg-options/src/z3c/password/principal.py small refactor

Adam Groszer agroszer at gmail.com
Mon Jun 15 08:52:07 EDT 2009


Log message for revision 100991:
  small refactor

Changed:
  U   z3c.password/branches/adamg-options/src/z3c/password/principal.py

-=-
Modified: z3c.password/branches/adamg-options/src/z3c/password/principal.py
===================================================================
--- z3c.password/branches/adamg-options/src/z3c/password/principal.py	2009-06-15 12:19:17 UTC (rev 100990)
+++ z3c.password/branches/adamg-options/src/z3c/password/principal.py	2009-06-15 12:52:06 UTC (rev 100991)
@@ -96,12 +96,17 @@
             # If the maximum amount of failures has been reached notify the
             # system by raising an error.
             if not ignoreFailures:
-                attempts = self._maxFailedAttempts()
-                if attempts is not None and self.failedAttempts > attempts:
+                if self.tooManyLoginFailures():
                     raise interfaces.TooManyLoginFailures(self)
 
         return same
 
+    def tooManyLoginFailures(self):
+        attempts = self._maxFailedAttempts()
+        if attempts is not None and self.failedAttempts > attempts:
+            return True
+        return False
+
     def passwordExpiresOn(self):
         expires = self._passwordExpiresAfter()
         if expires is None:



More information about the Checkins mailing list