diff --git a/kfet/views.py b/kfet/views.py index 0a3b6f99..dd4fb29a 100644 --- a/kfet/views.py +++ b/kfet/views.py @@ -68,20 +68,20 @@ class Home(TemplateView): def KFET_OPEN(): - kfet_open_date = cache.get('KFET_OPEN_DATE') - kfet_open = cache.get('KFET_OPEN') - if not kfet_open_date: + kfet_open_date = cache.get('KFET_OPEN_DATE', None) + kfet_open = cache.get('KFET_OPEN', None) + if kfet_open_date is None: kfet_open_date = timezone.now() cache.set('KFET_OPEN_DATE', kfet_open_date) - if not kfet_open: + if kfet_open is None: kfet_open = False cache.set('KFET_OPEN', kfet_open) return (kfet_open, kfet_open_date) def KFET_FORCE_CLOSE(): - kfet_force_close = cache.get('KFET_FORCE_CLOSE') - if not kfet_force_close: + kfet_force_close = cache.get('KFET_FORCE_CLOSE', None) + if kfet_force_close is None: kfet_force_close = False cache.set('KFET_FORCE_CLOSE', kfet_force_close) return kfet_force_close