diff options
author | Dylan William Hardison <dylan@mozilla.com> | 2015-06-02 07:18:13 +0200 |
---|---|---|
committer | Byron Jones <glob@mozilla.com> | 2015-06-02 07:18:13 +0200 |
commit | 587b71df697de3ddd3834cd9f241328b4437c242 (patch) | |
tree | 6957f2716263f96b87040632cd5830fcdb39235d /extensions/Review | |
parent | ec536745f491f4454bf4d8cd715227bfa727d795 (diff) | |
download | bugzilla-587b71df697de3ddd3834cd9f241328b4437c242.tar.gz bugzilla-587b71df697de3ddd3834cd9f241328b4437c242.tar.xz |
Bug 1169479: 500 error when attaching patch with r? but no reviewer
Diffstat (limited to 'extensions/Review')
-rw-r--r-- | extensions/Review/Extension.pm | 17 |
1 files changed, 8 insertions, 9 deletions
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; } } } |