From 55f1ce12cfb92c8e0df819ae6c145db4fbaf3438 Mon Sep 17 00:00:00 2001 From: Mouse Reeve Date: Tue, 1 Mar 2022 11:05:47 -0800 Subject: [PATCH] Second attempt at fixing tests using context processors --- 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 aeab55e2..9de75eda 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 and request.user.is_authenticated and request.user.theme: + if hasattr(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