Skip to content

Commit 9be9db1

Browse files
author
tailor
committed
[project @ Make SessionNegotiator.getAllowedType() clearer]
1 parent 8d9b409 commit 9be9db1

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

‎openid/association.py‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,12 @@ def isAllowed(self, assoc_type, session_type):
9898
return assoc_good and matches
9999

100100
def getAllowedType(self):
101-
"""Get a pair of assocation type and session type that are supported"""
102-
for pair in self.allowed_types:
103-
return pair
104-
105-
return (None, None)
101+
"""Get a pair of assocation type and session type that are
102+
supported"""
103+
try:
104+
return self.allowed_types[0]
105+
except IndexError:
106+
return (None, None)
106107

107108
default_negotiator = SessionNegotiator(default_association_order)
108109
encrypted_negotiator = SessionNegotiator(only_encrypted_association_order)

0 commit comments

Comments
 (0)