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:
authorDouwe Maan <douwe@selenight.nl>2017-03-21 18:28:47 +0300
committerLuke "Jared" Bennett <lbennett@gitlab.com>2017-04-05 19:44:14 +0300
commit874413cf701870a0fc1051f7c0a5fc4b4f884657 (patch)
tree6cb2917f6a72fc918c8f28d884597f36fe0de34b /app/mailers
parent79889a6aa3dc878d196d0f2f445ab6b10ef10c74 (diff)
Fix specs
Diffstat (limited to 'app/mailers')
-rw-r--r--app/mailers/emails/notes.rb1
-rw-r--r--app/mailers/notify.rb4
2 files changed, 3 insertions, 2 deletions
diff --git a/app/mailers/emails/notes.rb b/app/mailers/emails/notes.rb
index de58314fef2..a42745acd71 100644
--- a/app/mailers/emails/notes.rb
+++ b/app/mailers/emails/notes.rb
@@ -66,6 +66,7 @@ module Emails
def setup_note_mail(note_id, recipient_id)
@note = Note.find(note_id)
@project = @note.project
+ return unless @project
@sent_notification = SentNotification.record_note(@note, recipient_id, reply_key)
end
diff --git a/app/mailers/notify.rb b/app/mailers/notify.rb
index 14df6f8f0a3..f315e38bcaa 100644
--- a/app/mailers/notify.rb
+++ b/app/mailers/notify.rb
@@ -111,7 +111,7 @@ class Notify < BaseMailer
headers["X-GitLab-#{model.class.name}-ID"] = model.id
headers['X-GitLab-Reply-Key'] = reply_key
- if Gitlab::IncomingEmail.enabled?
+ if Gitlab::IncomingEmail.enabled? && @sent_notification
address = Mail::Address.new(Gitlab::IncomingEmail.reply_address(reply_key))
address.display_name = @project.name_with_namespace
@@ -176,6 +176,6 @@ class Notify < BaseMailer
end
headers['List-Unsubscribe'] = list_unsubscribe_methods.map { |e| "<#{e}>" }.join(',')
- @sent_notification_url = unsubscribe_sent_notification_url(@sent_notification)
+ @unsubscribe_url = unsubscribe_sent_notification_url(@sent_notification)
end
end