summaryrefslogtreecommitdiffstats
path: root/extensions/Review
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@mozilla.com>2015-06-02 07:18:13 +0200
committerByron Jones <glob@mozilla.com>2015-06-02 07:18:13 +0200
commit587b71df697de3ddd3834cd9f241328b4437c242 (patch)
tree6957f2716263f96b87040632cd5830fcdb39235d /extensions/Review
parentec536745f491f4454bf4d8cd715227bfa727d795 (diff)
downloadbugzilla-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.pm17
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;
}
}
}