Rework error system a bit to remove a bunch of duplicated code (#434)
This commit is contained in:
parent
08602b4279
commit
0c632d73b7
28 changed files with 197 additions and 350 deletions
|
@ -179,7 +179,7 @@ def logout(v):
|
|||
@auth_desired
|
||||
def sign_up_get(v):
|
||||
if not app.config['SETTINGS']['Signups']:
|
||||
return {"error": "New account registration is currently closed. Please come back later."}, 403
|
||||
abort(403, "New account registration is currently closed. Please come back later.")
|
||||
|
||||
if v: return redirect(SITE_FULL)
|
||||
|
||||
|
@ -225,7 +225,7 @@ def sign_up_get(v):
|
|||
@auth_desired
|
||||
def sign_up_post(v):
|
||||
if not app.config['SETTINGS']['Signups']:
|
||||
return {"error": "New account registration is currently closed. Please come back later."}, 403
|
||||
abort(403, "New account registration is currently closed. Please come back later.")
|
||||
|
||||
if v: abort(403)
|
||||
|
||||
|
@ -254,7 +254,6 @@ def sign_up_post(v):
|
|||
username = username.strip()
|
||||
|
||||
def signup_error(error):
|
||||
|
||||
args = {"error": error}
|
||||
if request.values.get("referred_by"):
|
||||
user = g.db.query(User).filter_by(id=request.values.get("referred_by")).one_or_none()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue