This commit is contained in:
Aevann1 2021-12-19 15:01:28 +02:00
parent 37233257ca
commit cb87196eee
111 changed files with 682 additions and 339 deletions

View file

@ -13,7 +13,9 @@ def authorize_prompt(v):
client_id = request.values.get("client_id")
application = g.db.query(OauthApp).filter_by(client_id=client_id).first()
if not application: return {"oauth_error": "Invalid `client_id`"}, 401
return render_template("oauth.html", v=v, application=application)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}oauth.html", v=v, application=application)
@app.post("/authorize")
@ -206,7 +208,9 @@ def admin_app_id(v, aid):
posts=get_posts(pids, v=v)
return render_template("admin/app.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/app.html",
v=v,
app=oauth,
listing=posts,
@ -233,7 +237,9 @@ def admin_app_id_comments(v, aid):
comments=get_comments(cids, v=v)
return render_template("admin/app.html",
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/app.html",
v=v,
app=oauth,
comments=comments,
@ -248,7 +254,9 @@ def admin_apps_list(v):
apps = g.db.query(OauthApp).all()
return render_template("admin/apps.html", v=v, apps=apps)
if v and v.oldsite: template = ''
else: template = 'CHRISTMAS/'
return render_template(f"{template}admin/apps.html", v=v, apps=apps)
@app.post("/oauth/reroll/<aid>")