2022-07-08 09:46:47 +00:00
|
|
|
from app.decorators import admin_required
|
2022-07-04 12:09:17 +00:00
|
|
|
from app.models import User
|
2022-07-08 09:46:47 +00:00
|
|
|
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('/')
|
2022-07-08 09:46:47 +00:00
|
|
|
@login_required
|
|
|
|
@admin_required
|
2022-07-04 12:09:17 +00:00
|
|
|
def users():
|
2022-07-08 09:46:47 +00:00
|
|
|
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',
|
2022-07-08 09:46:47 +00:00
|
|
|
title='Users',
|
|
|
|
dict_users=dict_users
|
2022-07-04 12:09:17 +00:00
|
|
|
)
|