Skip to content

Commit

Permalink
Default theme to light
Browse files Browse the repository at this point in the history
Signed-off-by: Jason Cameron <[email protected]>
  • Loading branch information
JasonLovesDoggo committed Sep 25, 2024
1 parent 2e2972c commit 2b6beb1
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions judge/template_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,20 @@ def site_name(request):

def site_theme(request):
# Middleware populating `profile` may not have loaded at this point if we're called from an error context.
if hasattr(request.user, 'profile'):
preferred_css = settings.DMOJ_THEME_CSS.get(request.profile.site_theme, settings.DMOJ_THEME_CSS['light'])
else:
preferred_css = None
return {
'DARK_STYLE_CSS': settings.DMOJ_THEME_CSS['dark'],
'LIGHT_STYLE_CSS': settings.DMOJ_THEME_CSS['light'],
'PREFERRED_STYLE_CSS': settings.DMOJ_THEME_CSS['dark'],
'PREFERRED_STYLE_CSS': preferred_css,
}


def math_setting(request):
caniuse = CanIUse(request.META.get('HTTP_USER_AGENT', ''))

# Middleware populating `profile` may not have loaded at this point if we're called from an error context.
if hasattr(request.user, 'profile'):
engine = request.profile.math_engine
Expand Down

0 comments on commit 2b6beb1

Please sign in to comment.