"list staffers pdf"
This commit is contained in:
parent
3a183a48b8
commit
e313608090
@ -1040,11 +1040,38 @@ def update_staff_slot(TURN_ID, SLOT_ID):
|
||||
@check_session
|
||||
def list_users():
|
||||
""" Users list """
|
||||
page = str(request.url_rule)
|
||||
menu = get_menu(page)
|
||||
message = check_user_info()
|
||||
staffers = Tetawebapp_users.query.filter(Tetawebapp_users.is_admin==0, Tetawebapp_users.link_id==None).order_by(Tetawebapp_users.name).all()
|
||||
return render_template('list_users.html', menu=menu, staffers=staffers, message=message)
|
||||
try:
|
||||
if session['is_admin']:
|
||||
page = str(request.url_rule)
|
||||
menu = get_menu(page)
|
||||
staffers = Tetawebapp_users.query.filter(Tetawebapp_users.is_admin==0, Tetawebapp_users.link_id==None).order_by(Tetawebapp_users.name).all()
|
||||
return render_template('list_users.html', menu=menu, staffers=staffers, message=message)
|
||||
# User is not admin
|
||||
return render_template('login_or_register.html', message="Utilisateur ou mot de passe invalide")
|
||||
except:
|
||||
# User is not logged in
|
||||
return render_template('login_or_register.html', message="Utilisateur ou mot de passe invalide")
|
||||
|
||||
@app.route("/users/pdf", methods=['GET', 'POST'])
|
||||
@check_session
|
||||
def print_users():
|
||||
""" Print user list """
|
||||
message = check_user_info()
|
||||
try:
|
||||
if session['is_admin']:
|
||||
page = str(request.url_rule)
|
||||
menu = get_menu(page)
|
||||
staffs = Tetawebapp_staffs.query(Tetawebapp_staffs.user_id).distinct()
|
||||
staffers = Tetawebapp_users.query.filter(Tetawebapp_users.is_admin==0, Tetawebapp_users.link_id==None).order_by(Tetawebapp_users.name).all()
|
||||
sstaffers = [staffer for staffer in staffers if staffer.id in staffs]
|
||||
return sstaffers
|
||||
# User is not admin
|
||||
return render_template('login_or_register.html', message="Utilisateur ou mot de passe invalide")
|
||||
except:
|
||||
# User is not logged in
|
||||
return render_template('login_or_register.html', message="Utilisateur ou mot de passe invalide")
|
||||
|
||||
|
||||
@app.route("/account/<ID>", methods=['GET', 'POST'])
|
||||
@check_session
|
||||
|
Loading…
Reference in New Issue
Block a user