forked from ScoDoc/DocScoDoc
blackify
This commit is contained in:
parent
e6e1835cca
commit
179442aa69
@ -459,7 +459,8 @@ def check_modif_user(
|
||||
"%s %s (pseudo=%s)" % (x.prenom, x.nom, x.user_name)
|
||||
for x in similar_users
|
||||
]
|
||||
) + MSG_OPT,
|
||||
)
|
||||
+ MSG_OPT,
|
||||
)
|
||||
# Roles ?
|
||||
return True, ""
|
||||
|
@ -284,7 +284,7 @@ def create_user_form(user_name=None, edit=0, all_roles=1):
|
||||
{
|
||||
"input_type": "separator",
|
||||
"title": "L'utilisateur appartient au département %s"
|
||||
% auth_dept,
|
||||
% auth_dept,
|
||||
},
|
||||
)
|
||||
)
|
||||
@ -295,7 +295,7 @@ def create_user_form(user_name=None, edit=0, all_roles=1):
|
||||
{
|
||||
"input_type": "separator",
|
||||
"title": "L'utilisateur sera crée dans le département %s"
|
||||
% auth_dept,
|
||||
% auth_dept,
|
||||
},
|
||||
)
|
||||
)
|
||||
@ -383,7 +383,7 @@ def create_user_form(user_name=None, edit=0, all_roles=1):
|
||||
|
||||
ok, msg = sco_users.check_modif_user(
|
||||
edit,
|
||||
ignore_optionals= force,
|
||||
ignore_optionals=force,
|
||||
user_name=user_name,
|
||||
nom=vals["nom"],
|
||||
prenom=vals["prenom"],
|
||||
@ -391,9 +391,7 @@ def create_user_form(user_name=None, edit=0, all_roles=1):
|
||||
roles=vals["roles"],
|
||||
)
|
||||
if not ok:
|
||||
H.append(
|
||||
tf_error_message(msg)
|
||||
)
|
||||
H.append(tf_error_message(msg))
|
||||
return "\n".join(H) + "\n" + tf[1] + F
|
||||
|
||||
if "date_expiration" in vals:
|
||||
@ -613,9 +611,9 @@ def form_change_password(user_name=None):
|
||||
# check access
|
||||
if not can_handle_passwd(u):
|
||||
return (
|
||||
"\n".join(H)
|
||||
+ "<p>Vous n'avez pas la permission de changer ce mot de passe</p>"
|
||||
+ F
|
||||
"\n".join(H)
|
||||
+ "<p>Vous n'avez pas la permission de changer ce mot de passe</p>"
|
||||
+ F
|
||||
)
|
||||
#
|
||||
H.append(
|
||||
@ -681,7 +679,7 @@ def change_password(user_name, password, password2):
|
||||
"<h2>Changement effectué !</h2><p>Ne notez pas ce mot de passe, mais mémorisez le !</p><p>Rappel: il est <b>interdit</b> de communiquer son mot de passe à un tiers, même si c'est un collègue de confiance !</p><p><b>Si vous n'êtes pas administrateur, le système va vous redemander votre login et nouveau mot de passe au prochain accès.</b></p>"
|
||||
)
|
||||
return (
|
||||
"""<?xml version="1.0" encoding="%s"?>
|
||||
"""<?xml version="1.0" encoding="%s"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html>
|
||||
<head>
|
||||
@ -689,10 +687,10 @@ def change_password(user_name, password, password2):
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=%s" />
|
||||
<body><h1>Mot de passe changé !</h1>
|
||||
"""
|
||||
% (scu.SCO_ENCODING, scu.SCO_ENCODING)
|
||||
+ "\n".join(H)
|
||||
+ '<a href="%s" class="stdlink">Continuer</a></body></html>'
|
||||
% scu.ScoURL()
|
||||
% (scu.SCO_ENCODING, scu.SCO_ENCODING)
|
||||
+ "\n".join(H)
|
||||
+ '<a href="%s" class="stdlink">Continuer</a></body></html>'
|
||||
% scu.ScoURL()
|
||||
)
|
||||
return html_sco_header.sco_header() + "\n".join(H) + F
|
||||
|
||||
@ -707,7 +705,7 @@ def toggle_active_user(user_name: str = None):
|
||||
raise ScoValueError("invalid user_name")
|
||||
form = DeactivateUserForm()
|
||||
if (
|
||||
request.method == "POST" and form.cancel.data
|
||||
request.method == "POST" and form.cancel.data
|
||||
): # if cancel button is clicked, the form.cancel.data will be True
|
||||
# flash
|
||||
return redirect(url_for("users.index_html", scodoc_dept=g.scodoc_dept))
|
||||
|
Loading…
Reference in New Issue
Block a user