mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Users should be able to remove their primary group
This fix allows a user to remove their currently assigned primary group if the Site Setting `user selected primary groups` is enabled. Before this fix, if a user selected "none" for their primary group it would silently fail and never be updated.
This commit is contained in:
@@ -89,6 +89,10 @@ class UserUpdater
|
||||
guardian.can_use_primary_group?(user, attributes[:primary_group_id])
|
||||
|
||||
user.primary_group_id = attributes[:primary_group_id]
|
||||
elsif SiteSetting.user_selected_primary_groups &&
|
||||
!attributes[:primary_group_id].present?
|
||||
|
||||
user.primary_group_id = nil
|
||||
end
|
||||
|
||||
CATEGORY_IDS.each do |attribute, level|
|
||||
|
||||
Reference in New Issue
Block a user