auth: Add an assertion check for context_data.

Signed-off-by: Zixuan James Li <p359101898@gmail.com>
This commit is contained in:
Zixuan James Li 2022-07-21 16:30:57 -04:00 committed by Tim Abbott
parent d238a448e6
commit 7233ad454f
1 changed files with 1 additions and 0 deletions

View File

@ -816,6 +816,7 @@ def login_page(
# added in SimpleTemplateResponse class, which is a derived class of
# HttpResponse. See django.template.response.SimpleTemplateResponse,
# https://github.com/django/django/blob/2.0/django/template/response.py#L19
assert template_response.context_data is not None
update_login_page_context(request, template_response.context_data)
assert isinstance(template_response, HttpResponse)