Skip to content
Prev Previous commit
Next Next commit
Use logger variable arguments
  • Loading branch information
Reece authored and Reece committed Apr 12, 2017
commit 4c259f87a2a396627c837ac9c0854452bbd5b7e6
14 changes: 7 additions & 7 deletions djangosaml2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,21 +163,21 @@ def login(request,
# ensure our selected binding is supported by the IDP
supported_bindings = get_idp_sso_supported_bindings(selected_idp)
if binding not in supported_bindings:
logger.debug('Binding %s not in IDP %s supported bindings: %s' % (
binding, selected_idp, supported_bindings))
logger.debug('Binding %s not in IDP %s supported bindings: %s',
binding, selected_idp, supported_bindings)
if binding == BINDING_HTTP_POST:
logger.warning('IDP %s does not support %s, trying %s' % (
selected_idp, binding, BINDING_HTTP_REDIRECT))
logger.warning('IDP %s does not support %s, trying %s',
selected_idp, binding, BINDING_HTTP_REDIRECT)
binding = BINDING_HTTP_REDIRECT
if sign_requests:
sign_requests = False
logger.warning('sp_authn_requests_signed is True, but ignoring because pysaml2 does not support it for %s' % BINDING_HTTP_REDIRECT)
logger.warning('sp_authn_requests_signed is True, but ignoring because pysaml2 does not support it for %s', BINDING_HTTP_REDIRECT)
else:
binding = BINDING_HTTP_POST
# if switched binding still not supported, give up
if binding not in supported_bindings:
raise UnsupportedBinding('IDP does not support %s or %s' % (
BINDING_HTTP_POST, BINDING_HTTP_REDIRECT))
raise UnsupportedBinding('IDP does not support %s or %s',
BINDING_HTTP_POST, BINDING_HTTP_REDIRECT)

client = Saml2Client(conf)
try:
Expand Down