mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-23 01:51:08 +00:00
Safer query for request user for tests
This commit is contained in:
parent
f4dc07b6b9
commit
9422a07414
1 changed files with 1 additions and 1 deletions
|
@ -10,7 +10,7 @@ def site_settings(request): # pylint: disable=unused-argument
|
||||||
|
|
||||||
site = models.SiteSettings.objects.get()
|
site = models.SiteSettings.objects.get()
|
||||||
theme = "css/themes/bookwyrm-light.scss"
|
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
|
theme = request.user.theme.path
|
||||||
elif site.default_theme:
|
elif site.default_theme:
|
||||||
theme = site.default_theme.path
|
theme = site.default_theme.path
|
||||||
|
|
Loading…
Reference in a new issue