Skip assigned issues even if "/assign" requested

* When a user requests for an issue by leaving comment
  "/assign", BOT tries to assign that issue to the requested user
  irrespective of its current state. However it should skip if
  the issue is already assigned.

Change-Id: Ib3d81e0556cf6b25c8b433650c1b9c3313f2631a
This commit is contained in:
siraj.yasin 2021-02-24 14:34:02 +00:00
parent 7abd3b56cd
commit 8efbca796e

View File

@ -78,8 +78,9 @@ def get_bot_comment(issue: Issue, bot_name: str, ps_number: str) -> IssueComment
def assign_issues(repo: github.Repository):
open_issues = [i for i in repo.get_issues() if i.state == 'open']
for issue in open_issues:
open_unassigned_issues = [i for i in repo.get_issues(
) if i.state == 'open' and len(i.assignees) == 0]
for issue in open_unassigned_issues:
try_assign(issue)