forked from rDrama/rDrama
Check for globals in calc_users; fix error pages.
parent
c428a59397
commit
c95e33831c
|
@ -9,6 +9,10 @@ import user_agents
|
||||||
import time
|
import time
|
||||||
|
|
||||||
def calc_users(v):
|
def calc_users(v):
|
||||||
|
# Some globals we expect aren't available when rendering error pages
|
||||||
|
if not g.agent or not ('session_id' in session):
|
||||||
|
return ''
|
||||||
|
|
||||||
loggedin = cache.get(f'{SITE}_loggedin') or {}
|
loggedin = cache.get(f'{SITE}_loggedin') or {}
|
||||||
loggedout = cache.get(f'{SITE}_loggedout') or {}
|
loggedout = cache.get(f'{SITE}_loggedout') or {}
|
||||||
timestamp = int(time.time())
|
timestamp = int(time.time())
|
||||||
|
|
Loading…
Reference in New Issue