Debug: Add button in admin panel to login to other accounts (#437)

This commit is contained in:
justcool393 2023-01-08 01:16:02 -08:00 committed by GitHub
parent ec4eafdbfc
commit 0ea72e3778
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 48 additions and 3 deletions

View file

@ -28,7 +28,7 @@ app.jinja_env.cache = {}
app.jinja_env.auto_reload = True
faulthandler.enable()
if bool_from_string(environ.get("ENFORCE_PRODUCTION", True)) and app.config["DEBUG"]:
if bool_from_string(environ.get("ENFORCE_PRODUCTION", True)) and app.debug:
raise ValueError("Debug mode is not allowed! If this is a dev environment, please set ENFORCE_PRODUCTION to false")
if environ.get("SITE_ID") is None:
@ -176,6 +176,7 @@ def before_request():
return 'Please use a "User-Agent" header!', 403
ua = g.agent.lower()
g.debug = app.debug
g.webview = ('; wv) ' in ua)
g.inferior_browser = (
'iphone' in ua or