<commit_before>from . import mentors
from flask import render_template, session, redirect, url_for, current_app, flash
from flask.ext.login import login_required, current_user, login_user
from ..decorators import mentor_required
from forms import TaskCreationForm, EditProfileForm, ContactForm
from ..models import User

@mentors.route('/')
def index():
    return render_template('mentor/menu.html')

@mentors.route('/signup')
# @mentors_required
def signup():
    return render_template('mentor/signup.html')

# TODO: modify - temporarily added by Annie
@mentors.route('/profile')
# @mentors_required
def profile():
    return render_template('mentor/profile.html')

@mentors.route('/tasks')
# @mentors_required
def tasks():
    return render_template('mentor/tasks.html')

@mentors.route('/students')
# @mentors_required
def students():
    return render_template('mentor/students.html')

@mentors.route('/students/<student_id>')
def student(student_id):
    form = ContactForm()
    student = User.query.get(student_id)
    if form.validate_on_submit():
        name = student.name
        flash(name + ' has been sent a message!')
        #TODO Send text to user 
        return render_template('mentors/students.html')
    return render_template('mentors/overview.html', form=form, student=student)

@mentors.route('/profile-edit', methods=['GET', 'POST'])
def profile_edit():
    form = EditProfileForm(obj=current_user)
    if form.validate_on_submit():
        current_user.name = form.name.data
        current_user.email = form.email.data
        if (form.new_password.data and form.current_password.data):
            if current_user.verify_password(form.current_password.data):<commit_msg>mentor view all students eroor<commit_after>from . import mentors
from flask import render_template, session, redirect, url_for, current_app, flash
from flask.ext.login import login_required, current_user, login_user
from ..decorators import mentor_required
from forms import TaskCreationForm, EditProfileForm, ContactForm
from ..models import User

@mentors.route('/')
def index():
    return render_template('mentor/menu.html')

@mentors.route('/signup')
# @mentors_required
def signup():
    return render_template('mentor/signup.html')

# TODO: modify - temporarily added by Annie
@mentors.route('/profile')
# @mentors_required
def profile():
    return render_template('mentor/profile.html')

@mentors.route('/tasks')
# @mentors_required
def tasks():
    return render_template('mentor/tasks.html')

@mentors.route('/students')
# @mentors_required
def students():
    return render_template('mentor/students.html')

@mentors.route('/students/<student_id>')
def student(student_id):
    form = ContactForm()
    student = User.query.get(student_id)
    if form.validate_on_submit():
        name = student.name
        flash(name + ' has been sent a message!')
        #TODO Send text to user
        return render_template('mentor/students.html')
    return render_template('mentor/overview.html', form=form, student=student)

@mentors.route('/profile-edit', methods=['GET', 'POST'])
def profile_edit():
    form = EditProfileForm(obj=current_user)
    if form.validate_on_submit():
        current_user.name = form.name.data
        current_user.email = form.email.data
        if (form.new_password.data and form.current_password.data):
            if current_user.verify_password(form.current_password.data):
{'fraction_non_alphanumeric': 0.12229373902867174, 'fraction_numerical': 0.0, 'mean_word_length': 4.586601307189542, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5680396', 'n_tokens_mistral': 1024, 'n_tokens_neox': 1014, 'n_words': 231}