def del_teacher_to_group(): if current_user.admin: form = SelectForm() form.group_list.choices = DB.teachergroup_list_form() if form.submit2.data: a = form.group_list.data a = a.split(" ") DB.delete_teacher_from_group(a[1], a[0]) return redirect(url_for("index")) return render_template("del_teacher_to_group.html", form=form) else: return redirect(url_for("index"))