from flask import Blueprint, flash, redirect, request, url_for from flask_login import current_user from flask_security.decorators import auth_required from .model_dependent_funs import active_semester_str from .models import Semester, db bp = Blueprint("main", __name__, root_path="/", template_folder="templates") @bp.app_context_processor def util_processor(): author_email = "mobitar@students.uni-mainz.de" footer = f"

This website is still under development (beta release)! If you have any questions, find any bugs or want some feature, please write a formless email (german/english) to Mo Bitar: {author_email}. Feedback is also welcome :)


" return dict(active_semester_str=active_semester_str, current_user=current_user, footer=footer) @bp.route("/") def index(): if current_user.has_role("admin"): endpoint_base = "admin" elif current_user.has_role("assistant"): endpoint_base = "assistant" else: return redirect(url_for("security.login")) if current_user.login_count == 1: url = url_for(endpoint_base + "_docs.index") else: url = url_for(endpoint_base + ".index") return redirect(url)