[inactive-gitlab-users] Consider all event types



commit 2d95b86e2a5d6c977f7c14346e493eb6f665c569
Author: Bartłomiej Piotrowski <bpiotrowski gnome org>
Date:   Wed Dec 8 21:35:12 2021 +0100

    Consider all event types

 inactive-gitlab-users.py | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)
---
diff --git a/inactive-gitlab-users.py b/inactive-gitlab-users.py
index 81fb966..db8939d 100644
--- a/inactive-gitlab-users.py
+++ b/inactive-gitlab-users.py
@@ -6,7 +6,6 @@ import argparse
 import datetime
 import json
 import os
-import re
 
 import gitlab
 import pytz
@@ -64,14 +63,12 @@ def is_user_trusted(user):
         return True
 
     events = user.events.list(all=True)
-    target_types = ('DiffNote', 'MergeRequest', 'DiscussionNote', 'MergeRequest', 'Note', 'Issue')
     for event in events:
-        if event.action_name == 'pushed to' or event.target_type in target_types:
-            project_id = event.project_id
-            project = gl.projects.get(project_id).path_with_namespace
-            if project.split('/')[0] in ('GNOME', 'Infrastructure', 'Teams'):
-                user.customattributes.set("trusted", "true")
-                return True
+        project_id = event.project_id
+        project = gl.projects.get(project_id).path_with_namespace
+        if project.split('/')[0] in ('GNOME', 'Infrastructure', 'Teams'):
+            user.customattributes.set("trusted", "true")
+            return True
 
     return False
 


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