mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Unassign user titles when a badge is deleted (#9573)
This commit is contained in:
@@ -129,9 +129,12 @@ class Admin::BadgesController < Admin::AdminController
|
||||
end
|
||||
|
||||
def destroy
|
||||
badge = find_badge
|
||||
StaffActionLogger.new(current_user).log_badge_deletion(badge)
|
||||
badge.destroy
|
||||
Badge.transaction do
|
||||
badge = find_badge
|
||||
StaffActionLogger.new(current_user).log_badge_deletion(badge)
|
||||
badge.clear_user_titles!
|
||||
badge.destroy!
|
||||
end
|
||||
render body: nil
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user