forked from MarseyWorld/MarseyWorld
Check for globals in calc_users; fix error pages.
parent
c428a59397
commit
c95e33831c
|
@ -9,6 +9,10 @@ import user_agents
|
|||
import time
|
||||
|
||||
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 {}
|
||||
loggedout = cache.get(f'{SITE}_loggedout') or {}
|
||||
timestamp = int(time.time())
|
||||
|
|
Loading…
Reference in New Issue