Skip to content

Commit

Permalink
Hue [py3] Fix SAML TemplateDoesNotExist
Browse files Browse the repository at this point in the history
  • Loading branch information
ranade1 committed Mar 9, 2022
1 parent 5204cd6 commit fa1b914
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

def template_failure(request, status=403, **kwargs):
""" Renders a SAML-specific template with general authentication error description. """
return render(request, 'djangosaml2/login_error.html', status=status)
return render(request, 'djangosaml2/login_error.html', status=status, using='django')


def exception_failure(request, exc_class=PermissionDenied, **kwargs):
Expand Down
12 changes: 6 additions & 6 deletions desktop/core/ext-py3/djangosaml2-0.18.0/djangosaml2/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ def login(request,
logger.debug('User is already logged in')
return render(request, authorization_error_template, {
'came_from': came_from,
})
}, using='django')

selected_idp = request.GET.get('idp', None)
conf = get_config(config_loader_path, request)
Expand All @@ -159,7 +159,7 @@ def login(request,
return render(request, wayf_template, {
'available_idps': idps.items(),
'came_from': came_from,
})
}, using='django')
else:
# is the first one, otherwise next logger message will print None
if not idps:
Expand Down Expand Up @@ -237,7 +237,7 @@ def login(request,
'SAMLRequest': saml_request,
'RelayState': came_from,
},
})
}, using='django')
except TemplateDoesNotExist:
pass

Expand Down Expand Up @@ -379,7 +379,7 @@ def echo_attributes(request,
except AttributeError:
return HttpResponse("No active SAML identity found. Are you sure you have logged in via SAML?")

return render(request, template, {'attributes': identity[0]})
return render(request, template, {'attributes': identity[0]}, using='django')


@login_required
Expand Down Expand Up @@ -473,7 +473,7 @@ def do_logout_service(request, data, binding, config_loader_path=None, next_page
'The session does not contain the subject id for user %s. Performing local logout',
request.user)
auth.logout(request)
return render(request, logout_error_template, status=403)
return render(request, logout_error_template, status=403, using='django')
else:
http_info = client.handle_logout_request(
data['SAMLRequest'],
Expand Down Expand Up @@ -507,7 +507,7 @@ def finish_logout(request, response, next_page=None):
return django_logout(request, next_page=next_page)
else:
logger.error('Unknown error during the logout')
return render(request, "djangosaml2/logout_error.html", {})
return render(request, "djangosaml2/logout_error.html", {}, using='django')


def metadata(request, config_loader_path=None, valid_for=None):
Expand Down

0 comments on commit fa1b914

Please sign in to comment.