nopaque/app/users/routes.py

18 lines
440 B
Python
Raw Normal View History

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