rename err to error for consistency

pull/102/head
Aevann 2023-01-27 13:19:56 +02:00
parent 15a9d53ba6
commit 580438908d
2 changed files with 4 additions and 4 deletions

View File

@ -362,7 +362,7 @@ def get_profile_picture(identifier:Union[int, str]) -> str:
return x.profile_url if x else 'not_found'
def get_err():
def get_error():
if request.referrer and request.referrer.split('?')[0] == request.base_url:
return request.values.get("err")
else:

View File

@ -321,7 +321,7 @@ def create_sub(v):
if not v.can_create_hole:
abort(403)
return render_template("sub/create_hole.html", v=v, cost=HOLE_COST, error=get_err())
return render_template("sub/create_hole.html", v=v, cost=HOLE_COST, error=get_error())
@app.post("/create_hole")
@limiter.limit(DEFAULT_RATELIMIT, key_func=get_ID)
@ -335,12 +335,12 @@ def create_sub2(v):
name = name.strip().lower()
if not valid_sub_regex.fullmatch(name):
return redirect(f"/create_hole?err=Mame does not match the required format!"), 400
return redirect(f"/create_hole?error=Name does not match the required format!"), 400
sub = get_sub_by_name(name, graceful=True)
if not sub:
if not v.charge_account('coins', HOLE_COST):
return redirect(f"/create_hole?err=You don't have enough coins!"), 403
return redirect(f"/create_hole?error=You don't have enough coins!"), 403
g.db.add(v)
if v.shadowbanned: abort(500)