fix typo role RespPe

This commit is contained in:
Emmanuel Viennet 2021-09-05 18:14:16 +02:00
parent f4335624fc
commit 4e2fab29d5

View File

@ -59,7 +59,7 @@ def import_scodoc7_user_db(scodoc7_db="dbname=SCOUSERS"):
roles7 = [] roles7 = []
for role_dept in roles7: for role_dept in roles7:
# Migre les rôles RespPeX, EnsX, AdminX, SecrX et ignore les autres # Migre les rôles RespPeX, EnsX, AdminX, SecrX et ignore les autres
m = re.match(r"^(-?Ens|-?Secr|-?ResPe|-?Admin)(.*)$", role_dept) m = re.match(r"^(-?Ens|-?Secr|-?RespPe|-?Admin)(.*)$", role_dept)
if not m: if not m:
msg = f"User {user_name}: role inconnu '{role_dept}' (ignoré)" msg = f"User {user_name}: role inconnu '{role_dept}' (ignoré)"
current_app.logger.warning(msg) current_app.logger.warning(msg)
@ -75,7 +75,7 @@ def import_scodoc7_user_db(scodoc7_db="dbname=SCOUSERS"):
dept = m.group(2) dept = m.group(2)
role = Role.query.filter_by(name=role_name).first() role = Role.query.filter_by(name=role_name).first()
if not role: if not role:
msg = f"User {user_name}: ignoring role '{role_dept}'" msg = f"Role '{role_name}' introuvable. User {user_name}: ignoring role '{role_dept}'"
current_app.logger.warning(msg) current_app.logger.warning(msg)
messages.append(msg) messages.append(msg)
else: else: