mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 06:41:25 +08:00
FEATURE: Replace existing badge owners when using the bulk award feature (#8770)
* FEATURE: Replace existing badge owners when using the bulk award feature * Use ActiveRecord to sanitize title update query, Change replace checkbox text Co-Authored-By: Robin Ward <robin.ward@gmail.com> Co-authored-by: Robin Ward <robin.ward@gmail.com>
This commit is contained in:
@ -43,6 +43,9 @@ class Admin::BadgesController < Admin::AdminController
|
||||
badge = Badge.find_by(id: params[:badge_id])
|
||||
raise Discourse::InvalidParameters if csv_file.try(:tempfile).nil? || badge.nil?
|
||||
|
||||
replace_badge_owners = params[:replace_badge_owners] == 'true'
|
||||
BadgeGranter.revoke_all(badge) if replace_badge_owners
|
||||
|
||||
batch_number = 1
|
||||
line_number = 1
|
||||
batch = []
|
||||
|
Reference in New Issue
Block a user