mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: broken select badge as user title (#5474)
* FIX: broken select badge as user title * selected id wasn’t pass to underlying component * <none> was rendered as an html tag <none></none> * overriding a badge name wouldn’t work as it was using badge.name and not badge.display_name * adds a spec to ensure this behavior is correct
This commit is contained in:
@@ -178,7 +178,7 @@ class UsersController < ApplicationController
|
||||
|
||||
user_badge = UserBadge.find_by(id: params[:user_badge_id])
|
||||
if user_badge && user_badge.user == user && user_badge.badge.allow_title?
|
||||
user.title = user_badge.badge.name
|
||||
user.title = user_badge.badge.display_name
|
||||
user.user_profile.badge_granted_title = true
|
||||
user.save!
|
||||
user.user_profile.save!
|
||||
|
||||
Reference in New Issue
Block a user