from app.utils.priv_required import priv_required
from app.models.user import Member, Group, GroupPrivilege
from app.models.priv import SpecialPrivilege
from app.utils.render import render
from app import app, db


@app.route('/admin/membres', methods=['GET', 'POST'])
@priv_required('misc.admin-panel')
def adm_members():
    users = Member.query.all()
    users = sorted(users, key = lambda x: x.name)

    return render('admin/members.html', users=users)
