mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Flair icon being removed when updating other profile info
The commit: 75069ff179
allows users to remove their primary group, but this introduced a bug
where if you were to edit any other profile info like location or
website which is a form on a separate page then the flair dropdown,
would cause the selected flair to be removed.
This fix ensures that if the `primary_group_id` parameter is missing
from the update payload it does not remove the existing
`primary_group_id`. It will only remove the `primary_group_id` if it is
present in the payload and empty.
This commit is contained in:
@@ -90,6 +90,7 @@ class UserUpdater
|
||||
|
||||
user.primary_group_id = attributes[:primary_group_id]
|
||||
elsif SiteSetting.user_selected_primary_groups &&
|
||||
attributes[:primary_group_id] &&
|
||||
attributes[:primary_group_id].blank?
|
||||
|
||||
user.primary_group_id = nil
|
||||
|
||||
Reference in New Issue
Block a user