This commit is contained in:
2024-05-20 20:36:46 +02:00
parent d6f7fa0661
commit 2153bb07b9
6 changed files with 373 additions and 306 deletions

View File

@ -7,7 +7,8 @@ from get_mysql import get_mysql
import atexit
from flask_apscheduler import APScheduler
def create():
def create(testing: bool = False):
"""
Erstellt die Flask-App inkl. Datenbank und Login-Manager.
:return app:
@ -25,7 +26,8 @@ def create():
login_manager.login_view = "login"
# Shut down the scheduler when exiting the app
atexit.register(lambda: scheduler.shutdown())
if not testing:
atexit.register(lambda: scheduler.shutdown())
@login_manager.user_loader
def load_user(uid: int):