FIX: should not be able to rename a system badge

This commit is contained in:
Régis Hanol
2017-02-20 14:35:05 +01:00
parent cb99f59ec3
commit f51e3b2131
4 changed files with 96 additions and 102 deletions

View File

@@ -98,7 +98,7 @@ class Admin::BadgesController < Admin::AdminController
def update_badge_from_params(badge, opts={})
errors = []
Badge.transaction do
allowed = Badge.column_names.map(&:to_sym)
allowed = Badge.column_names.map(&:to_sym)
allowed -= [:id, :created_at, :updated_at, :grant_count]
allowed -= Badge.protected_system_fields if badge.system?
allowed -= [:query] unless SiteSetting.enable_badge_sql