stupidness removed

This commit is contained in:
Qwann 2017-04-10 17:18:43 +02:00
parent cb9ba76a4f
commit e0b0a53112

View file

@ -68,20 +68,20 @@ class Home(TemplateView):
def KFET_OPEN(): def KFET_OPEN():
kfet_open_date = cache.get('KFET_OPEN_DATE') kfet_open_date = cache.get('KFET_OPEN_DATE', None)
kfet_open = cache.get('KFET_OPEN') kfet_open = cache.get('KFET_OPEN', None)
if not kfet_open_date: if kfet_open_date is None:
kfet_open_date = timezone.now() kfet_open_date = timezone.now()
cache.set('KFET_OPEN_DATE', kfet_open_date) cache.set('KFET_OPEN_DATE', kfet_open_date)
if not kfet_open: if kfet_open is None:
kfet_open = False kfet_open = False
cache.set('KFET_OPEN', kfet_open) cache.set('KFET_OPEN', kfet_open)
return (kfet_open, kfet_open_date) return (kfet_open, kfet_open_date)
def KFET_FORCE_CLOSE(): def KFET_FORCE_CLOSE():
kfet_force_close = cache.get('KFET_FORCE_CLOSE') kfet_force_close = cache.get('KFET_FORCE_CLOSE', None)
if not kfet_force_close: if kfet_force_close is None:
kfet_force_close = False kfet_force_close = False
cache.set('KFET_FORCE_CLOSE', kfet_force_close) cache.set('KFET_FORCE_CLOSE', kfet_force_close)
return kfet_force_close return kfet_force_close