@auth.route('/register', methods=['GET', 'POST'])
def register():
    form = RegistrationForm()
    if form.validate_on_submit():
        group = Group(name=form.name.data, password=form.password.data)
        db.session.add(group)
        db.session.commit()
        return redirect(url_for('auth.login'))
    title = 'New Account'
    return render_template('auth/register.html', registration_form=form, title=title)
@auth.route('/register', methods=['GET', 'POST'])
def register():
    form = RegistrationForm()
    if form.validate_on_submit():
        group = Group(name=form.name.data, password=form.password.data)
        db.session.add(group)
        db.session.commit()
        return redirect(url_for('auth.login'))
    title = 'New Account'
    return render_template('auth/register.html', registration_form=form, title=title)