default theme setting
This commit is contained in:
parent
ce88e5dd3c
commit
4ba2241228
2 changed files with 7 additions and 7 deletions
|
@ -42,13 +42,12 @@ def theme(request):
|
|||
themes = css_themes_all()
|
||||
else:
|
||||
themes = css_themes_public()
|
||||
active_theme_id = request.session.get('theme', 0)
|
||||
if active_theme_id in themes:
|
||||
active_theme = themes[active_theme_id]
|
||||
else:
|
||||
active_theme_id = 0
|
||||
active_theme = themes[0]
|
||||
request.session['theme'] = active_theme_id
|
||||
default_theme_id = settings.DEFAULT_THEME if settings.DEFAULT_THEME in themes else 0
|
||||
active_theme_id = request.session.get('theme', default_theme_id)
|
||||
if active_theme_id not in themes:
|
||||
active_theme_id = default_theme_id
|
||||
|
||||
active_theme = themes[active_theme_id]
|
||||
|
||||
if active_theme['randomize_primary_color']:
|
||||
from c3nav.site.themes import get_random_primary_color
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue