From 587b71df697de3ddd3834cd9f241328b4437c242 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Tue, 2 Jun 2015 13:18:13 +0800 Subject: Bug 1169479: 500 error when attaching patch with r? but no reviewer --- extensions/Review/Extension.pm | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) (limited to 'extensions/Review') diff --git a/extensions/Review/Extension.pm b/extensions/Review/Extension.pm index 66fdef3e0..e97269272 100644 --- a/extensions/Review/Extension.pm +++ b/extensions/Review/Extension.pm @@ -602,20 +602,19 @@ sub flag_end_of_update { my ($name, $value) = $change =~ /^(.+)(.)$/; if ($name eq 'review' && $value eq '?') { - if ($reviewer eq '' && $bug->product_obj->reviewer_required) { - ThrowUserError('reviewer_required'); + if ($reviewer eq '') { + ThrowUserError('reviewer_required') if $bug->product_obj->reviewer_required; } + else { + my $reviewer_obj = Bugzilla::User->check({ + name => $reviewer, + cache => 1 + }); - my $reviewer_obj = Bugzilla::User->new({ - name => $reviewer, - cache => 1 - }); - - if (!$reviewer_obj->is_active) { ThrowUserError('reviewer_inactive', { reviewer => $reviewer_obj, timeout => Bugzilla->params->{max_reviewer_last_seen} - }); + }) unless $reviewer_obj->is_active; } } } -- cgit v1.2.3-24-g4f1b