From a47aef7a0172dad16555ea0b8d80c7c69da0ccf3 Mon Sep 17 00:00:00 2001 From: Yurii Dubinka Date: Thu, 22 Apr 2021 22:51:23 +0300 Subject: [PATCH] #373: Self assignment is allowed Fixed #373 --- lib/lazylead/task/assignment.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/lazylead/task/assignment.rb b/lib/lazylead/task/assignment.rb index abd64e3..3762aa6 100644 --- a/lib/lazylead/task/assignment.rb +++ b/lib/lazylead/task/assignment.rb @@ -67,10 +67,8 @@ def initialize(issue, allowed, silent) # Gives true when last change of "Assignee" field was done # by not authorized person. def illegal? - @allowed.none? do |a| - return false if last.nil? - a == last["author"]["name"] - end + return false if last.nil? || @issue.assignee.id.eql?(last["author"]["name"]) + @allowed.none? { |a| a.eql? last["author"]["name"] } end # Detect details about last change of "Assignee" to non-null value