remotes/1693045480750635534/spooky-22
Aevann1 2021-07-26 02:13:07 +02:00
parent 20122a8252
commit 1cfb893f53
2 changed files with 3 additions and 12 deletions

View File

@ -7,7 +7,7 @@ def session_over18():
now = int(time.time())
return session.get('over_18', {}).get(1) >= now
return session.get('over_18', 0) >= now
def make_logged_out_formkey(t):

View File

@ -159,12 +159,7 @@ def error_503(e, v):
@validate_formkey
def allow_nsfw_logged_in(v):
cutoff = int(time.time()) + 3600
if not session.get("over_18", None):
session["over_18"] = {}
session["over_18"][1] = cutoff
if not session.get("over_18"): session["over_18"] = int(time.time()) + 3600
return redirect(request.form.get("redir"))
@ -183,11 +178,7 @@ def allow_nsfw_logged_out(v):
):
abort(403)
if not session.get("over_18", None):
session["over_18"] = {}
cutoff = int(time.time()) + 3600
session["over_18"][1] = cutoff
if not session.get("over_18"): session["over_18"] = int(time.time()) + 3600
return redirect(request.form.get("redir"))