<s> from flask import Blueprint , render_template , url_for , redirect , flash , request <EOL> from flask . ext . login import login_required <EOL> from flask_login import current_user <EOL> from comport . public . forms import LoginForm <EOL> blueprint = Blueprint ( "<STR_LIT:user>" , __name__ , url_prefix = '<STR_LIT>' , <EOL> static_folder = "<STR_LIT>" ) <EOL> @ blueprint . route ( "<STR_LIT:/>" ) <EOL> @ login_required <EOL> def home ( ) : <EOL> form = LoginForm ( request . form ) <EOL> if current_user . is_admin ( ) : <EOL> redirect_url = url_for ( "<STR_LIT>" ) <EOL> return redirect ( redirect_url ) <EOL> else : <EOL> if current_user . first_department ( ) : <EOL> return redirect ( url_for ( "<STR_LIT>" , department_id = current_user . first_department ( ) . id ) ) <EOL> else : <EOL> flash ( "<STR_LIT>" , '<STR_LIT>' ) <EOL> return render_template ( "<STR_LIT>" , form = form , published = True ) </s>
