Skip to content

Commit

Permalink
code style
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunsi committed Dec 26, 2023
1 parent b15ef2b commit 31b8555
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def authorized(access_token):
return redirect(url_for("faq", _anchor="signup"))

session["gh_login"] = github_user["login"]
if 'redirect_after_login' in session:
if "redirect_after_login" in session:
return redirect(session["redirect_after_login"])
return redirect(url_for("dashboard"))

Expand Down Expand Up @@ -310,6 +310,7 @@ def faq():


if "INTERRUPT_KEY" in app.config:

@app.route("/interrupt/{}".format(app.config["INTERRUPT_KEY"]))
def saal():
interrupt_key = get_scoped_api_key(
Expand Down Expand Up @@ -452,7 +453,9 @@ def asset_to_tiles(asset):
mode="update",
)
else:
log.info("[Setup {}] Config has not changed, skipping update".format(setup_id))
log.info(
"[Setup {}] Config has not changed, skipping update".format(setup_id)
)

r.set("last-sync", int(time.time()))
log.info("updated everything")
Expand All @@ -464,7 +467,7 @@ def asset_to_tiles(asset):
def content_list():
if not g.user:
session["redirect_after_login"] = request.url
return redirect(url_for('login'))
return redirect(url_for("login"))
assets = get_user_assets()
random.shuffle(assets)
return jsonify(
Expand All @@ -476,7 +479,7 @@ def content_list():
def content_upload():
if not g.user:
session["redirect_after_login"] = request.url
return redirect(url_for('login'))
return redirect(url_for("login"))

if g.user.lower() not in app.config.get("ADMIN_USERS", set()):
max_uploads = r.get(f"max_uploads:{g.user}")
Expand Down Expand Up @@ -545,7 +548,7 @@ def content_upload():
def content_request_review(asset_id):
if not g.user:
session["redirect_after_login"] = request.url
return redirect(url_for('login'))
return redirect(url_for("login"))

try:
asset = ib.get(f"asset/{asset_id}")
Expand Down Expand Up @@ -598,7 +601,7 @@ def content_moderate(asset_id, sig):
abort(404)
if not g.user:
session["redirect_after_login"] = request.url
return redirect(url_for('login'))
return redirect(url_for("login"))
elif g.user.lower() not in app.config.get("ADMIN_USERS", set()):
abort(401)

Expand Down Expand Up @@ -633,7 +636,7 @@ def content_moderate_result(asset_id, sig, result):
abort(404)
if not g.user:
session["redirect_after_login"] = request.url
return redirect(url_for('login'))
return redirect(url_for("login"))
elif g.user.lower() not in app.config.get("ADMIN_USERS", set()):
abort(401)

Expand All @@ -656,7 +659,7 @@ def content_moderate_result(asset_id, sig, result):
def content_update(asset_id):
if not g.user:
session["redirect_after_login"] = request.url
return redirect(url_for('login'))
return redirect(url_for("login"))

try:
asset = ib.get(f"asset/{asset_id}")
Expand All @@ -682,7 +685,7 @@ def content_update(asset_id):
def content_delete(asset_id):
if not g.user:
session["redirect_after_login"] = request.url
return redirect(url_for('login'))
return redirect(url_for("login"))

try:
asset = ib.get(f"asset/{asset_id}")
Expand Down

0 comments on commit 31b8555

Please sign in to comment.