Second attempt at fixing tests using context processors

This commit is contained in:
Mouse Reeve 2022-03-01 11:05:47 -08:00
parent 4cdbdd8d0b
commit 55f1ce12cf

View file

@ -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