nopaque/app/users/routes.py

18 lines
440 B
Python

from app.decorators import admin_required
from app.models import User
from flask import render_template, request
from flask_login import login_required
from . import bp
@bp.route('/')
@login_required
@admin_required
def users():
dict_users = [u.to_dict(backrefs=True, relationships=False) for u in User.query.all()]
return render_template(
'users/users.html.j2',
title='Users',
dict_users=dict_users
)