|
@@ -38,9 +38,11 @@ s = smtplib.SMTP(confsmtp.get('host', 'localhost'))
|
|
|
pp = pprint.PrettyPrinter()
|
|
|
|
|
|
if confac.get('audit_dolibarr_users', False):
|
|
|
- usrfields = ["firstname", "lastname", "email"]
|
|
|
+ usrfields = ["rowid", "firstname", "lastname", "email"]
|
|
|
cur = doli.get_users(fields=usrfields, active_user=True, active_member=False)
|
|
|
badusers = cur.fetchall()
|
|
|
+ # Exception for user id = 1 (default admin user)
|
|
|
+ badusers = list(filter(lambda usr: usr[0] != 1, badusers))
|
|
|
if len(badusers) != 0:
|
|
|
body = "Salut, \n\nDes utilisateurs ne sont pas associés à un membre actif : \n\n" + pp.pformat(badusers)
|
|
|
msg = MIMEText(body)
|