Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2016-06-20 14:15:54 +0300
committerLin Jen-Shin <godfat@godfat.org>2016-06-20 14:15:54 +0300
commit176fa21cb75f404b401e021f0cdcc6a138c207eb (patch)
tree2cfd8750023078ee6036eed4ffc31b2482fe5fc4 /lib/gitlab/email/handler
parent0671db52a8152ad6d0c4104fa5fc437b9fd6c69d (diff)
raise UnknownIncomingEmail when there's no mail_key:
So that we don't have to pretend that CreateNoteHandler could handle a nil mail_key. Also, since NilClass#=~ would just return nil for any regular expression, we could just match it without checking nilness. Feedback: https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/3363#note_12566407
Diffstat (limited to 'lib/gitlab/email/handler')
-rw-r--r--lib/gitlab/email/handler/create_note_handler.rb3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/gitlab/email/handler/create_note_handler.rb b/lib/gitlab/email/handler/create_note_handler.rb
index 69646651223..06dae31cc27 100644
--- a/lib/gitlab/email/handler/create_note_handler.rb
+++ b/lib/gitlab/email/handler/create_note_handler.rb
@@ -6,8 +6,7 @@ module Gitlab
module Handler
class CreateNoteHandler < BaseHandler
def can_handle?
- # We want to raise SentNotificationNotFoundError for missing key
- !!(mail_key.nil? || mail_key =~ /\A\w+\z/)
+ mail_key =~ /\A\w+\z/
end
def execute