[sysadmin-bin] Run GPG/SSH checks before inactivity check



commit 4888c6d4d2f479986e25042315de604c828d5ac1
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Mon Oct 25 11:24:09 2021 +0200

    Run GPG/SSH checks before inactivity check

 gitlab/inactive-gitlab-users.py | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)
---
diff --git a/gitlab/inactive-gitlab-users.py b/gitlab/inactive-gitlab-users.py
index 94a635a..01cea9d 100755
--- a/gitlab/inactive-gitlab-users.py
+++ b/gitlab/inactive-gitlab-users.py
@@ -98,6 +98,14 @@ def get_inactive_users(gl, timedelta_unit, timedelta_value):
         if dateparser(attrs["created_at"]) > timedelta:
             continue
 
+        # Skip users who configured SSH or GPG keys in their profile
+        if user.keys.list() or user.gpgkeys.list():
+            continue
+
+        # Skip users with at least two identities
+        if len(user.identities) >= 2:
+            continue
+
         created_at = timestamp2date(attrs["created_at"])
         current_sign_in_at = timestamp2date(attrs["current_sign_in_at"])
         last_activity_on = timestamp2date(attrs["last_activity_on"])
@@ -122,14 +130,6 @@ def get_inactive_users(gl, timedelta_unit, timedelta_value):
                             user.customattributes.set("trusted", "true")
                             break
 
-        # Skip users who configured SSH or GPG keys in their profile
-        if user.keys.list() or user.gpgkeys.list():
-            continue
-
-        # Skip users with at least two identities
-        if len(user.identities) >= 2:
-            continue
-
         if attrs["bio"] and len(attrs["bio"]) > 0:
             # Some users set URL in bio, check it against surbl
             if re.match("http[s]?://", attrs["bio"], re.IGNORECASE):


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