fix key error for themes with randomized primary color
This commit is contained in:
parent
639815545c
commit
8c0e258a65
1 changed files with 4 additions and 1 deletions
|
@ -1,3 +1,5 @@
|
|||
from contextlib import suppress
|
||||
|
||||
from c3nav import settings
|
||||
from c3nav.mapdata.utils.cache.cache_decorator import mapdata_cache
|
||||
|
||||
|
@ -69,6 +71,7 @@ def make_themes(theme_models):
|
|||
modify_vars(css_vars)
|
||||
primary_color = css_vars['primary'] if 'primary' in css_vars else base_theme['primary_color']
|
||||
if theme.randomize_primary_color:
|
||||
with suppress(KeyError):
|
||||
del css_vars['primary']
|
||||
css_vars_str = css_vars_as_str(css_vars)
|
||||
css_code = (':root{%s}' % css_vars_str)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue