From 66e88c960ee4812ca346144cdf58a4534b03fce0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 5 Sep 2022 19:13:09 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- impostor/templatetags/impostor_tags.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/impostor/templatetags/impostor_tags.py b/impostor/templatetags/impostor_tags.py index 2cc579f..e2e3f9c 100644 --- a/impostor/templatetags/impostor_tags.py +++ b/impostor/templatetags/impostor_tags.py @@ -1,6 +1,7 @@ """template tags for impostor.""" from django import template + from impostor.models import ImpostorLog register = template.Library() @@ -14,7 +15,9 @@ def get_impersonated_as(request): :return: """ try: - impersonated_as = ImpostorLog.objects.get(token=request.session['impostor_token']) + impersonated_as = ImpostorLog.objects.get( + token=request.session["impostor_token"] + ) except (ImpostorLog.DoesNotExist, KeyError): impersonated_as = None