mirror of
https://gitlab.com/allianceauth/allianceauth.git
synced 2026-02-10 09:06:21 +01:00
Theme handling improvements
This commit is contained in:
@@ -21,8 +21,11 @@ def get_theme_from_hooks(theme, hooks):
|
||||
def get_theme(request):
|
||||
theme = settings.DEFAULT_THEME
|
||||
hooks = get_hooks('theme_hook')
|
||||
if request.user:
|
||||
theme = request.user.profile.theme or theme
|
||||
|
||||
try:
|
||||
theme = request.session.get('THEME', settings.DEFAULT_THEME_DARK if request.session.get('NIGHT_MODE', False) is True else settings.DEFAULT_THEME)
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
theme_hook = get_theme_from_hooks(theme, hooks)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user