This commit is contained in:
Aevann1 2022-01-28 05:22:31 +02:00
parent 7844b0821e
commit 65122c970b
5 changed files with 49 additions and 63 deletions

View file

@ -170,8 +170,8 @@ def logout(v):
@app.get("/signup")
@auth_desired
def sign_up_get(v):
with open('disable_signups', 'r') as f:
if f.read() == "yes": return {"error": "New account registration is currently closed. Please come back later."}, 403
if environ.get('disable_signups'):
return {"error": "New account registration is currently closed. Please come back later."}, 403
if v: return redirect(f"{SITE_FULL}/")
@ -214,8 +214,8 @@ def sign_up_get(v):
@limiter.limit("1/minute;5/day")
@auth_desired
def sign_up_post(v):
with open('disable_signups', 'r') as f:
if f.read() == "yes": return {"error": "New account registration is currently closed. Please come back later."}, 403
if environ.get('disable_signups'):
return {"error": "New account registration is currently closed. Please come back later."}, 403
if v: abort(403)