Use helpers.tag and safe_join instead of html_safe (#11916)

This commit is contained in:
Anna Buianova 2020-12-16 10:02:19 +03:00 committed by GitHub
parent f6278a9106
commit 1ae0b4f47a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -76,14 +76,12 @@ module Admin
@user = User.find(params[:id])
begin
Moderator::DeleteUser.call(user: @user)
link = helpers.link_to("the page", admin_users_gdpr_delete_requests_path, "data-no-instant" => true)
# rubocop:disable Rails/OutputSafety
link = helpers.tag.a("the page", href: admin_users_gdpr_delete_requests_path, data: { "no-instant" => true })
message = "@#{@user.username} (email: #{@user.email.presence || 'no email'}, user_id: #{@user.id}) " \
"has been fully deleted. " \
"If this is a GDPR delete, delete them from Mailchimp & Google Analytics " \
" and confirm on #{link}.".html_safe
# rubocop:enable Rails/OutputSafety
flash[:success] = message
" and confirm on "
flash[:success] = helpers.safe_join([message, link, "."])
rescue StandardError => e
flash[:danger] = e.message
end