changeset 2380:0d04c8c82eb6

slightly optimise openid preferences
author Johannes Berg <johannes AT sipsolutions DOT net>
date Tue, 17 Jul 2007 12:34:34 +0200
parents 24bfe5789665
children b8b87daf7cc4
files MoinMoin/userprefs/oid.py
diffstat 1 files changed, 8 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/userprefs/oid.py	Tue Jul 17 12:32:27 2007 +0200
+++ b/MoinMoin/userprefs/oid.py	Tue Jul 17 12:34:34 2007 +0200
@@ -29,14 +29,14 @@
         self._ = request.getText
         self.cfg = request.cfg
         self.title = self._("OpenID settings")
-
-    def allowed(self):
-        if _openid_disabled:
-            return False
-        for authm in self.request.cfg.auth:
-            if isinstance(authm, OpenIDAuth):
-                return UserPrefBase.allowed(self)
-        return False
+        openid_auth = False
+        if not _openid_disabled:
+            for authm in self.request.cfg.auth:
+                if isinstance(authm, OpenIDAuth):
+                    openid_auth = True
+                    break
+        if not openid_auth:
+            self.allowed = lambda: False
 
     def _handle_remove(self):
         _ = self.request.getText