Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix render_login_html_to_string (refs: #53) #54

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions djangosaml2idp/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,10 +184,10 @@ def build_authn_response(self, user, authn, resp_args, processor: BaseProcessor,
)
return authn_resp

def render_login_html_to_string(self, template_name, context=None, request=None, using=None):
def render_login_html_to_string(self, context=None, request=None, using=None):
""" Render the html response for the login action. Can be using a custom html template if set on the view. """
default_login_template_name = 'djangosaml2idp/login.html'
custom_login_template_name = getattr(self, 'login_html_template')
custom_login_template_name = getattr(self, 'login_html_template', None)
if custom_login_template_name:
Copy link
Contributor Author

@mjholtkamp mjholtkamp Feb 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only other call to render_login_html_to_string is from create_html_response and it only passes two kwargs (context and request), no args. So I think this is a leftover of a refactor.

In the code template_name is not being used, so I just removed it and handled the case where there is no login_html_template set.

try:
template = get_template(custom_login_template_name, using=using)
Expand Down