@auth.route('/login', methods=['GET', 'POST'])
def login():
    login_form = LoginForm()
    if login_form.validate_on_submit():
        group = Group.query.filter_by(name=login_form.name.data).first()
        if ((group is not None) and group.verify_password(login_form.password.data)):
            login_user(group, login_form.remember.data)
            return redirect((request.args.get('next') or url_for('main.group', id=group.id)))
        flash('Invalid group name or password')
    title = 'Login'
    return render_template('auth/login.html', login_form=login_form, title=title)
@auth.route('/login', methods=['GET', 'POST'])
def login():
    login_form = LoginForm()
    if login_form.validate_on_submit():
        group = Group.query.filter_by(name=login_form.name.data).first()
        if ((group is not None) and group.verify_password(login_form.password.data)):
            login_user(group, login_form.remember.data)
            return redirect((request.args.get('next') or url_for('main.group', id=group.id)))
        flash('Invalid group name or password')
    title = 'Login'
    return render_template('auth/login.html', login_form=login_form, title=title)