summaryrefslogtreecommitdiff
path: root/openid/association.py
diff options
context:
space:
mode:
authortailor <cygnus@janrain.com>2006-12-21 19:07:54 +0000
committertailor <cygnus@janrain.com>2006-12-21 19:07:54 +0000
commit9be9db19979ab80ef74ce8fcf7f2b7b8c389334b (patch)
tree3d8ef4ab0fb7038d9cb6e1217a4c0df7a533ad5b /openid/association.py
parent8d9b409a3206e1a8c2dffe4ea928c3cb040edb20 (diff)
downloadopenid-9be9db19979ab80ef74ce8fcf7f2b7b8c389334b.tar.gz
[project @ Make SessionNegotiator.getAllowedType() clearer]
Diffstat (limited to 'openid/association.py')
-rw-r--r--openid/association.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/openid/association.py b/openid/association.py
index 19e95d1..feec0cb 100644
--- a/openid/association.py
+++ b/openid/association.py
@@ -98,11 +98,12 @@ class SessionNegotiator(object):
return assoc_good and matches
def getAllowedType(self):
- """Get a pair of assocation type and session type that are supported"""
- for pair in self.allowed_types:
- return pair
-
- return (None, None)
+ """Get a pair of assocation type and session type that are
+ supported"""
+ try:
+ return self.allowed_types[0]
+ except IndexError:
+ return (None, None)
default_negotiator = SessionNegotiator(default_association_order)
encrypted_negotiator = SessionNegotiator(only_encrypted_association_order)