forked from Github-Mirrors/canaille
22 lines
623 B
Python
22 lines
623 B
Python
from flask import Blueprint, render_template
|
|
from web.models import AuthorizationCode
|
|
from web.flaskutils import admin_needed
|
|
|
|
|
|
bp = Blueprint(__name__, "authorizations")
|
|
|
|
|
|
@bp.route("/")
|
|
@admin_needed()
|
|
def index():
|
|
authorizations = AuthorizationCode.filter()
|
|
return render_template(
|
|
"admin/authorization_list.html", authorizations=authorizations
|
|
)
|
|
|
|
|
|
@bp.route("/<authorization_id>", methods=["GET", "POST"])
|
|
@admin_needed()
|
|
def view(authorization_id):
|
|
authorization = AuthorizationCode.get(authorization_id)
|
|
return render_template("admin/authorization_view.html", authorization=authorization)
|