[inactive-gitlab-users] Trust users with at least two verified e-mail addresses



commit 8ceb621406024294a6061582e3aeb60a2395e99e
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Wed Dec 8 22:08:19 2021 +0100

    Trust users with at least two verified e-mail addresses

 inactive-gitlab-users.py | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/inactive-gitlab-users.py b/inactive-gitlab-users.py
index c856b26..632ceb7 100644
--- a/inactive-gitlab-users.py
+++ b/inactive-gitlab-users.py
@@ -62,6 +62,11 @@ def is_user_trusted(user):
         user.customattributes.set("trusted", "true")
         return True
 
+    confirmed_emails = [x for x in user.emails.list() if x.confirmed_at or len(x.confirmed_at) > 0]
+    if len(confirmed_emails) >= 2:
+        user.customattributes.set("trusted", "true")
+        return True
+
     events = user.events.list(all=True)
     for event in events:
         project_id = event.project_id


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]