Skip to content

Commit

Permalink
Merge pull request #2001 from scottsds/issue_3747
Browse files Browse the repository at this point in the history
3747: Pass in ID instead of User and Work Objects
  • Loading branch information
CristinaRO committed Jan 28, 2015
2 parents f68c71c + be1754e commit eb67880
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/controllers/admin/user_creations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def hide
users = creation.pseuds.map(&:user).uniq
users.each do |user|
unless user == orphan_account
UserMailer.admin_hidden_work_notification(creation, user).deliver
UserMailer.admin_hidden_work_notification(creation.id, user.id).deliver
end
end
redirect_to(creation)
Expand Down
8 changes: 4 additions & 4 deletions app/mailers/user_mailer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -294,12 +294,12 @@ def admin_deleted_work_notification(user, work)
end

# Sends email to authors when a creation is hidden by an Admin
def admin_hidden_work_notification(creation, user)
@user = user
@work = creation
def admin_hidden_work_notification(creation_id, user_id)
@user = User.find_by_id(user_id)
@work = Work.find_by_id(creation_id)

mail(
to: user.email,
to: @user.email,
subject: "[#{ArchiveConfig.APP_SHORT_NAME}] Your work has been hidden by the Abuse Team"
)
end
Expand Down

0 comments on commit eb67880

Please sign in to comment.