From 9422a07414262df83fe3eeecf23db530aba179ea Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 1 Mar 2022 10:36:19 -0800 Subject: [PATCH] Safer query for request user for tests --- bookwyrm/context_processors.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bookwyrm/context_processors.py b/bookwyrm/context_processors.py index b5110d24..aeab55e2 100644 --- a/bookwyrm/context_processors.py +++ b/bookwyrm/context_processors.py @@ -10,7 +10,7 @@ def site_settings(request): # pylint: disable=unused-argument site = models.SiteSettings.objects.get() theme = "css/themes/bookwyrm-light.scss" - if request.user.is_authenticated and request.user.theme: + if request.user and request.user.is_authenticated and request.user.theme: theme = request.user.theme.path elif site.default_theme: theme = site.default_theme.path