Added decorator for admin

This commit is contained in:
2025-04-15 10:58:52 +02:00
parent e186f735a7
commit a9ecdcaa7d
4 changed files with 27 additions and 6 deletions

View File

@@ -1,6 +1,7 @@
from flask import Blueprint, render_template
from flask_login import login_required # type: ignore
from application.dash.models import Service
from application.decorators import admin_required
dash_blueprint = Blueprint("dash", __name__, template_folder="templates")
@@ -12,3 +13,9 @@ dash_blueprint = Blueprint("dash", __name__, template_folder="templates")
def index():
services = Service.query.all() # type: ignore
return render_template("dashboard.html", services=services)
@dash_blueprint.route("/admin", methods=["GET", "POST"])
# @admin_required
def admin():
return render_template("admin.html")