This commit is contained in:
Kevin Chung
2015-01-18 20:07:02 -05:00
parent 1882d8231d
commit 3b93a40f2b
6 changed files with 44 additions and 13 deletions

View File

@@ -1,5 +1,5 @@
from flask import render_template, request, redirect, abort, jsonify, url_for, session
from CTFd.utils import sha512, is_safe_url, authed, mailserver, sendmail
from CTFd.utils import sha512, is_safe_url, authed, mailserver, sendmail, can_register
from CTFd.models import db, Teams
from itsdangerous import TimedSerializer, BadTimeSignature
@@ -56,6 +56,8 @@ Did you initiate a password reset?
@app.route('/register', methods=['POST', 'GET'])
def register():
if not can_register():
return redirect('/login')
if request.method == 'POST':
errors = []
name_len = len(request.form['name']) == 0