Fix minor syntax issues in saml2 provider
authorSimo Sorce <simo@redhat.com>
Wed, 19 Mar 2014 21:08:51 +0000 (17:08 -0400)
committerSimo Sorce <simo@redhat.com>
Wed, 19 Mar 2014 21:34:01 +0000 (17:34 -0400)
Signed-off-by: Simo Sorce <simo@redhat.com>
ipsilon/providers/saml2/auth.py
ipsilon/providers/saml2/provider.py

index 0dd16b8..ff81af6 100755 (executable)
@@ -183,7 +183,7 @@ class AuthenticateRequest(ProviderPageBase):
             raise AuthenticationError("Unavailable Name ID type",
                                       lasso.SAML2_STATUS_CODE_AUTHN_FAILED)
 
             raise AuthenticationError("Unavailable Name ID type",
                                       lasso.SAML2_STATUS_CODE_AUTHN_FAILED)
 
-        # TODO: add user attributes as policy requires taking from 'usersession'
+        # TODO: add user attributes as policy requires from 'usersession'
 
     def saml2error(self, login, code, message):
         status = lasso.Samlp2Status()
 
     def saml2error(self, login, code, message):
         status = lasso.Samlp2Status()
index 03efeb3..d3ed5da 100755 (executable)
@@ -89,7 +89,7 @@ class ServiceProvider(object):
 
     def get_valid_nameid(self, nip):
         self._debug('Requested NameId [%s]' % (nip.format,))
 
     def get_valid_nameid(self, nip):
         self._debug('Requested NameId [%s]' % (nip.format,))
-        if nip.format == None:
+        if nip.format is None:
             return NAMEID_MAP[self.default_nameid]
         elif nip.format == lasso.SAML2_NAME_IDENTIFIER_FORMAT_UNSPECIFIED:
             return NAMEID_MAP[self.default_nameid]
             return NAMEID_MAP[self.default_nameid]
         elif nip.format == lasso.SAML2_NAME_IDENTIFIER_FORMAT_UNSPECIFIED:
             return NAMEID_MAP[self.default_nameid]