From 1e8e7d00fe16fc22dc98d51d0a99f30c3520af76 Mon Sep 17 00:00:00 2001 From: Kohei Yoshino Date: Fri, 12 Apr 2019 17:15:11 -0400 Subject: [PATCH] Bug 1543798 - Do not treat email addresses with invalid.bugs as unassigned when displaying bugs --- extensions/BMO/Extension.pm | 4 ++-- .../BugModal/template/en/default/bug_modal/edit.html.tmpl | 2 +- extensions/ComponentWatching/Extension.pm | 2 +- template/en/default/attachment/create.html.tmpl | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/extensions/BMO/Extension.pm b/extensions/BMO/Extension.pm index e618e83ef..c34a567be 100644 --- a/extensions/BMO/Extension.pm +++ b/extensions/BMO/Extension.pm @@ -995,7 +995,7 @@ sub _bug_reporters_hw_os { sub _bug_is_unassigned { my ($self) = @_; my $assignee = $self->assigned_to->login; - return $assignee eq 'nobody@mozilla.org' || $assignee =~ /\.bugs$/; + return $assignee eq 'nobody@mozilla.org' || $assignee =~ /@(?!invalid).+\.bugs$/; } sub _bug_has_current_patch { @@ -1176,7 +1176,7 @@ sub object_start_of_update { # and the assignee isn't a real person return unless $new_bug->assigned_to->login eq 'nobody@mozilla.org' - || $new_bug->assigned_to->login =~ /\.bugs$/; + || $new_bug->assigned_to->login =~ /@(?!invalid).+\.bugs$/; # and the user can set the status to NEW return diff --git a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl index e94c43b6f..66e8f40ce 100644 --- a/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl +++ b/extensions/BugModal/template/en/default/bug_modal/edit.html.tmpl @@ -20,7 +20,7 @@ # these are used in a few places is_cced = bug.cc.contains(user.login); unassigned = (bug.assigned_to.login == "nobody@mozilla.org") - || (bug.assigned_to.login.search('\.bugs$')); + || (bug.assigned_to.login.search('@(?!invalid).+\.bugs$')); # custom fields that have custom rendering, or should not be rendered rendered_custom_fields = [ diff --git a/extensions/ComponentWatching/Extension.pm b/extensions/ComponentWatching/Extension.pm index c1051111c..4e4a2583e 100644 --- a/extensions/ComponentWatching/Extension.pm +++ b/extensions/ComponentWatching/Extension.pm @@ -243,7 +243,7 @@ sub _check_watch_user { if ($value eq '') { ThrowUserError('component_watch_missing_watch_user'); } - if ($value !~ /\.bugs$/i) { + if ($value !~ /@(?!invalid).+\.bugs$/i) { ThrowUserError('component_watch_invalid_watch_user'); } return Bugzilla::User->check($value)->id; diff --git a/template/en/default/attachment/create.html.tmpl b/template/en/default/attachment/create.html.tmpl index bdeda59df..1fc876d60 100644 --- a/template/en/default/attachment/create.html.tmpl +++ b/template/en/default/attachment/create.html.tmpl @@ -74,7 +74,7 @@ If you want to assign this [% terms.bug %] to yourself, check the box below.
- [% IF bug.assigned_to.login == "nobody@mozilla.org" || bug.assigned_to.login.search('.bugs$') %] + [% IF bug.assigned_to.login == "nobody@mozilla.org" || bug.assigned_to.login.search('@(?!invalid).+\.bugs$') %] [% take_if_patch = 1 %] [% END %] -- 2.47.3