Example #1
0
def add_studentgroup2(class_id):
    if current_user.admin:
        form = SelectForm()
        form.group_list.choices = DB.group_list_form(class_id)
        form.a1.choices = DB.student_list_form()
        if form.submit2.data:
            DB.add_student_to_group(form.a1.data, form.group_list.data)
            return redirect(url_for("add_studentgroup"))
        return render_template("add_stundentgroup2.html", form=form)
    else:
        return redirect(url_for("index"))