Files
Sternsinger/CMBNet/cmbnet/admin/accounts.py
T
2026-10-23 00:05:06 +02:00

21 lines
603 B
Python

"""
Accountverwaltung
"""
from flask import Blueprint, render_template, g
from cmbnet.auth import role_required
from cmbnet.db import get_db
admin_accounts_bp = Blueprint('admin', __name__)
@admin_accounts_bp.route('/accounts')
@role_required('Administrator')
def accounts(**kwargs):
"""Accountverwaltung"""
db = get_db()
accounts = db.execute(
'SELECT a.*, t.code as tenant_code FROM accounts a JOIN tenants t ON a.tenant_id = t.id WHERE a.tenant_id = ? ORDER BY a.id',
(g.tenant_id,)
).fetchall()
return render_template('admin/accounts.html', accounts=accounts)