FIX: Fill acting_user field instead of target_user in history

This commit is contained in:
Dan Ungureanu 2020-06-16 13:30:58 +03:00
parent 219bb0b6a7
commit 84dfaad137
No known key found for this signature in database
GPG Key ID: 0AA2A00D6ACC8B84
2 changed files with 3 additions and 3 deletions

View File

@ -232,7 +232,7 @@ class UsersController < ApplicationController
if current_user.staff? && current_user != user
StaffActionLogger.new(current_user).log_update_email(user)
else
UserHistory.create!(action: UserHistory.actions[:update_email], target_user_id: user.id)
UserHistory.create!(action: UserHistory.actions[:update_email], acting_user_id: user.id)
end
end
@ -264,7 +264,7 @@ class UsersController < ApplicationController
if current_user.staff? && current_user != user
StaffActionLogger.new(current_user).log_destroy_email(user)
else
UserHistory.create(action: UserHistory.actions[:destroy_email], target_user_id: user.id)
UserHistory.create(action: UserHistory.actions[:destroy_email], acting_user_id: user.id)
end
end

View File

@ -38,7 +38,7 @@ class EmailUpdater
if @guardian.is_staff? && @guardian.user != @user
StaffActionLogger.new(@guardian.user).log_add_email(@user)
else
UserHistory.create!(action: UserHistory.actions[:add_email], target_user_id: @user.id)
UserHistory.create!(action: UserHistory.actions[:add_email], acting_user_id: @user.id)
end
if @guardian.is_staff? && !@user.staff?