fix additional error due to flask patch

master
Aevann 2023-08-23 00:43:36 +03:00
parent 3f7a15c431
commit a9a68ae79d
4 changed files with 5 additions and 0 deletions

View File

@ -30,6 +30,7 @@ def cron_fn(every_5m, every_1d):
with app.app_context():
g.db = db_session()
g.v = None
g.vid = None
try:
if every_5m:

View File

@ -10,6 +10,7 @@ from files.__main__ import app, limiter, get_CF, redis_instance
@app.before_request
def before_request():
g.v = None
g.vid = None
if request.host != SITE:
abort(403, "Unauthorized host provided!")

View File

@ -115,6 +115,7 @@ def on_login(account, redir=None):
session.permanent = True
session["lo_user"] = account.id
g.v = account
g.vid = account.id
session["login_nonce"] = account.login_nonce
check_for_alts(account, include_current_session=True)
@ -341,6 +342,7 @@ def sign_up_post(v):
session.permanent = True
session["lo_user"] = new_user.id
g.v = new_user
g.vid = new_user.id
check_for_alts(new_user, include_current_session=True)
send_notification(new_user.id, WELCOME_MSG)

View File

@ -107,6 +107,7 @@ def get_logged_in_user():
abort(403, "Site is in offline mode right now. It will be back shortly!")
g.v = v
g.vid = v.id
if not v and SITE == 'rdrama.net' and request.headers.get("Cf-Ipcountry") == 'EG':
abort(404)