don't cache theme colors past a mapdata update

This commit is contained in:
Gwendolyn 2024-03-18 23:23:14 +01:00
parent 1989098d7e
commit d42cd01e95

View file

@ -73,9 +73,14 @@ class ThemeColorManager:
class ColorManager:
themes = {}
default_theme = None
cache_key = None
@classmethod
def for_theme(cls, theme):
from c3nav.mapdata.models import MapUpdate
if cls.cache_key != MapUpdate.current_cache_key:
cls.default_theme = None
cls.themes = {}
if theme is None:
if cls.default_theme is None:
cls.default_theme = ThemeColorManager()