summaryrefslogtreecommitdiffstats
path: root/extensions/Review
diff options
context:
space:
mode:
authorByron Jones <bjones@mozilla.com>2013-07-26 08:02:34 +0200
committerByron Jones <bjones@mozilla.com>2013-07-26 08:02:34 +0200
commitb0cd974e5c57ec5781053699fb9b2ffc5697be4c (patch)
tree714407286014774a15f96ef87851740b02378ec6 /extensions/Review
parentd780cce675a9fbc7eaa0872315f1761a9de79be8 (diff)
downloadbugzilla-b0cd974e5c57ec5781053699fb9b2ffc5697be4c.tar.gz
bugzilla-b0cd974e5c57ec5781053699fb9b2ffc5697be4c.tar.xz
Bug 897473: exclude users from the review suggestions list who have "unavailable" or "PTO" in their real name
Diffstat (limited to 'extensions/Review')
-rw-r--r--extensions/Review/Extension.pm6
1 files changed, 5 insertions, 1 deletions
diff --git a/extensions/Review/Extension.pm b/extensions/Review/Extension.pm
index d4e9ae761..51755ca2c 100644
--- a/extensions/Review/Extension.pm
+++ b/extensions/Review/Extension.pm
@@ -18,6 +18,8 @@ use Bugzilla::Error;
use Bugzilla::User;
use Bugzilla::Util qw(clean_text);
+use constant UNAVAILABLE_RE => qr/\b(?:unavailable|pto)\b/i;
+
#
# monkey-patched methods
#
@@ -58,7 +60,9 @@ sub _reviewers_objs {
# so we have to reorder the list
my $users = Bugzilla::User->new_from_list($user_ids);
my %user_map = map { $_->id => $_ } @$users;
- my @reviewers = map { $user_map{$_} } @$user_ids;
+ my @reviewers =
+ grep { $_->name !~ UNAVAILABLE_RE }
+ map { $user_map{$_} } @$user_ids;
$object->{reviewers} = \@reviewers;
}
return $object->{reviewers};