diff options
Diffstat (limited to 'extensions/Review/Extension.pm')
-rw-r--r-- | extensions/Review/Extension.pm | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/extensions/Review/Extension.pm b/extensions/Review/Extension.pm index e97269272..ef83b61b4 100644 --- a/extensions/Review/Extension.pm +++ b/extensions/Review/Extension.pm @@ -25,6 +25,7 @@ use Bugzilla::User::Setting; use Bugzilla::Util qw(clean_text datetime_from diff_arrays); use constant UNAVAILABLE_RE => qr/\b(?:unavailable|pto|away)\b/i; +use constant MENTOR_LIMIT => 10; # # monkey-patched methods @@ -171,11 +172,14 @@ sub object_validators { sub _bug_check_bug_mentors { my ($self, $value) = @_; my %seen; - return [ + my $mentors = [ grep { !$seen{$_->id}++ } map { Bugzilla::User->check({ name => $_, cache => 1 }) } ref($value) ? @$value : ($value) ]; + if (scalar(@$mentors) > MENTOR_LIMIT) { + ThrowUserError('mentor_limit_exceeded', { limit => MENTOR_LIMIT }); + } } sub bug_user_match_fields { |