site settings

This commit is contained in:
Aevann1 2022-04-12 21:05:50 +02:00
parent 442355bde7
commit 265a13a601
11 changed files with 116 additions and 109 deletions

View file

@ -179,9 +179,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 not app.config['SETTINGS']['Signups']:
return {"error": "New account registration is currently closed. Please come back later."}, 403
if v: return redirect(SITE_FULL)
@ -226,9 +225,8 @@ def sign_up_get(v):
@limiter.limit("10/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 not app.config['SETTINGS']['Signups']:
return {"error": "New account registration is currently closed. Please come back later."}, 403
if v: abort(403)