mirror of
https://github.com/wahyd4/gitlabhq.git
synced 2026-08-17 16:46:06 +10:00
Only pass abuse report ID to AbuseReportMailer.
This commit is contained in:
@@ -9,11 +9,12 @@ class AbuseReportsController < ApplicationController
|
||||
@abuse_report.reporter = current_user
|
||||
|
||||
if @abuse_report.save
|
||||
if current_application_settings.admin_notification_email.present?
|
||||
AbuseReportMailer.delay.notify(@abuse_report.id)
|
||||
end
|
||||
|
||||
message = "Thank you for your report. A GitLab administrator will look into it shortly."
|
||||
redirect_to root_path, notice: message
|
||||
if current_application_settings.admin_notification_email.present?
|
||||
AbuseReportMailer.delay.notify(@abuse_report, current_application_settings.admin_notification_email)
|
||||
end
|
||||
else
|
||||
render :new
|
||||
end
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
class AbuseReportMailer < BaseMailer
|
||||
include Gitlab::CurrentSettings
|
||||
|
||||
def notify(abuse_report, to_email)
|
||||
@abuse_report = abuse_report
|
||||
def notify(abuse_report_id)
|
||||
@abuse_report = AbuseReport.find(abuse_report_id)
|
||||
|
||||
mail(to: to_email, subject: "[Gitlab] Abuse report filed for `#{@abuse_report.user.username}`")
|
||||
mail(
|
||||
to: current_application_settings.admin_notification_email,
|
||||
subject: "#{@abuse_report.user.name} (#{@abuse_report.user.username}) was reported for abuse"
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user