]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 1605179 - Don't assign bugs when a revision is abandoned
authorbyron jones <byron@glob.com.au>
Tue, 14 Jan 2020 15:48:45 +0000 (23:48 +0800)
committerdklawren <dklawren@users.noreply.github.com>
Tue, 14 Jan 2020 15:48:45 +0000 (10:48 -0500)
extensions/PhabBugz/lib/Util.pm

index 21e1091061ad0e7ac03721d42310fa64c139a11d..3c1bd2640356ae34d98d24d4724e79806fe8f4a9 100644 (file)
@@ -14,6 +14,7 @@ use warnings;
 use Bugzilla::Bug;
 use Bugzilla::Constants;
 use Bugzilla::Error;
+use Bugzilla::Logging;
 use Bugzilla::User;
 use Bugzilla::Types qw(:types);
 use Bugzilla::Util qw(trim);
@@ -93,7 +94,12 @@ sub create_revision_attachment {
 
   # Assign the bug to the submitter if it isn't already owned and
   # the revision has reviewers assigned to it.
-  if (!is_bug_assigned($bug) && @{$revision->reviews}) {
+  if (
+    !is_bug_assigned($bug)
+    && $revision->status ne 'abandoned'
+    && @{$revision->reviews}
+  ) {
+    INFO('Assigning bug ' . $bug->id . ' to ' . $submitter->email);
     $bug->set_assigned_to($submitter);
     $bug->set_bug_status('ASSIGNED') if $bug->status->name eq 'NEW';
   }