зеркало из https://github.com/mozilla/bugbot.git
Reduce email noise when unassigning inactive users (#2412)
This commit is contained in:
Родитель
67eaf1db7d
Коммит
27b545dacc
|
@ -9,10 +9,11 @@ from libmozdata import utils as lmdutils
|
|||
from bugbot import logger, people, utils
|
||||
from bugbot.bzcleaner import BzCleaner
|
||||
from bugbot.constants import HIGH_PRIORITY, HIGH_SEVERITY
|
||||
from bugbot.nag_me import Nag
|
||||
from bugbot.user_activity import UserActivity
|
||||
|
||||
|
||||
class AssigneeNoLogin(BzCleaner):
|
||||
class AssigneeNoLogin(BzCleaner, Nag):
|
||||
def __init__(self):
|
||||
super(AssigneeNoLogin, self).__init__()
|
||||
self.unassign_weeks = utils.get_config(self.name(), "unassign_weeks", 2)
|
||||
|
@ -21,6 +22,7 @@ class AssigneeNoLogin(BzCleaner):
|
|||
self.default_assignees = utils.get_default_assignees()
|
||||
self.people = people.People.get_instance()
|
||||
self.unassign_count = collections.defaultdict(int)
|
||||
self.no_bugmail = True
|
||||
|
||||
self.extra_ni = {}
|
||||
|
||||
|
@ -88,6 +90,8 @@ class AssigneeNoLogin(BzCleaner):
|
|||
self.add_action(bug)
|
||||
res[bugid] = bug
|
||||
|
||||
self.add([bug["assigned_to"], bug["triage_owner"]], bug)
|
||||
|
||||
return res
|
||||
|
||||
def add_action(self, bug):
|
||||
|
@ -168,6 +172,9 @@ class AssigneeNoLogin(BzCleaner):
|
|||
|
||||
return params
|
||||
|
||||
def nag_template(self):
|
||||
return self.name() + ".html"
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
AssigneeNoLogin().run()
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
<p>The following {{ plural('bug has', data, pword='bugs have') }} an assignee who is inactive on Bugzilla:</p>
|
||||
<p>The following {{ plural('bug has', data, pword='bugs have') }} been unassigned due to assignee inactivity:</p>
|
||||
<table {{ table_attrs }}>
|
||||
<thead>
|
||||
<tr>
|
||||
|
|
Загрузка…
Ссылка в новой задаче