# Group avatar flair doesn't apply to existing members

**URL:** https://meta.discourse.org/t/group-avatar-flair-doesnt-apply-to-existing-members/206210
**Category:** Bug
**Created:** [October 16, 2021, 7:59am UTC](https://meta.discourse.org/t/group-avatar-flair-doesnt-apply-to-existing-members/206210 "2021-10-16T07:59:21Z")
**Posts on this page:** 10
**Page:** 1

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [October 16, 2021, 7:59am UTC](https://meta.discourse.org/t/group-avatar-flair-doesnt-apply-to-existing-members/206210/1 "2021-10-16T07:59:21Z")

</div>

Over the past few days I’ve experienced this on two forums. When a group doesn’t have a flair upon creation and a flair is added at a later point of time, the existing members of the group don’t get the flair on their profile.

Set group as primary setting has no effect. I have to manually assign the group as primary for each existing user for the flair to show up or else it doesn’t show up.

On the other hand, any new users added to the group do get the flair. Only existing members are affected.

---

<div class="post-metadata">

### Author: ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)
#### Post date: [October 25, 2021, 9:11pm UTC](https://meta.discourse.org/t/group-avatar-flair-doesnt-apply-to-existing-members/206210/2 "2021-10-25T21:11:06Z")

</div>

when you update an Avatar Flair Image, it only updates the people that have that group set as primary.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [October 26, 2021, 2:38am UTC](https://meta.discourse.org/t/group-avatar-flair-doesnt-apply-to-existing-members/206210/3 "2021-10-26T02:38:49Z")

</div>

But I have the setting “Set Group as Primary” enabled in the group setting and it sadly has no effect for existing group members.

It does gives them the title properly when the setting is enabled (and removes it when setting is disabled) but flair is not applied.

---

<div class="post-metadata">

### Author: ![IAmGav](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/iamgav/32/235598_2.png) [@IAmGav](https://meta.discourse.org/u/IAmGav)
#### Post date: [October 26, 2021, 8:08am UTC](https://meta.discourse.org/t/group-avatar-flair-doesnt-apply-to-existing-members/206210/4 "2021-10-26T08:08:36Z")

</div>

> [@itsbhanusharma](#):
>
> But I have the setting “Set Group as Primary” enabled in the group setting and it sadly has no effect for existing group members.

Yes, this only works for newly added members.

> [@itsbhanusharma](#):
>
> It does gives them the title properly when the setting is enabled (and removes it when setting is disabled) but flair is not applied.

When no title is set, it set them the group title, but if a title is set already, then it wont update the title.

Have you tried refreshing the page after changing the icon ?

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [October 26, 2021, 8:35am UTC](https://meta.discourse.org/t/group-avatar-flair-doesnt-apply-to-existing-members/206210/5 "2021-10-26T08:35:18Z")

</div>

Yes, I have tried refreshing the page and No, it doesn’t make a difference.

The thing is that the setting used to work differently in past. When I used to enable the “Set Group as Primary”, it used to automatically set it as primary for all the existing and new users. Now that’s broken in a way where the Group title of the primary group is applied correctly to all the members but not the flair. This seems to be a recent change that broke the setting. I remember it working correctly as expected back in Jan/Feb this year when I set up the groups on my forums.

---

<div class="post-metadata">

### Author: ![nathank](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/nathank/32/290039_2.png) [@nathank](https://meta.discourse.org/u/nathank)
#### Post date: [October 28, 2021, 7:33am UTC](https://meta.discourse.org/t/group-avatar-flair-doesnt-apply-to-existing-members/206210/8 "2021-10-28T07:33:18Z")

</div>

I’ve posted a way you can force group members to use the group avatar now that primary group and avatar seem to be uncoupled:

> [@Can no longer assign avatar flair by setting primary group](https://meta.discourse.org/t/can-no-longer-assign-avatar-flair-by-setting-primary-group/206185/2):
>
> This forces group members to have the group avatar: rails c target\_group = Group.find\_by\_name("=GroupSlug=") users = User.joins(:group\_users).where(group\_users:{group\_id: target\_group.id}) users.each do |u| u.flair\_group\_id = target\_group.id u.save end Exit

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [October 28, 2021, 10:46am UTC](https://meta.discourse.org/t/group-avatar-flair-doesnt-apply-to-existing-members/206210/9 "2021-10-28T10:46:41Z")

</div>

I’ll definitely try it out once I’m at my desk. Thanks for the solution @nathank

---

<div class="post-metadata">

### Author: ![vinothkannans](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vinothkannans/32/86465_2.png) [@vinothkannans](https://meta.discourse.org/u/vinothkannans)
#### Post date: [October 28, 2021, 4:50pm UTC](https://meta.discourse.org/t/group-avatar-flair-doesnt-apply-to-existing-members/206210/10 "2021-10-28T16:50:20Z")

</div>

[https://github.com/discourse/discourse/pull/14762](https://github.com/discourse/discourse/pull/14762)

I added a fix for this issue in the above PR.

---

<div class="post-metadata">

### Author: ![itsbhanusharma](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/itsbhanusharma/32/180717_2.png) [@itsbhanusharma](https://meta.discourse.org/u/itsbhanusharma)
#### Post date: [October 29, 2021, 4:52am UTC](https://meta.discourse.org/t/group-avatar-flair-doesnt-apply-to-existing-members/206210/11 "2021-10-29T04:52:59Z")

</div>

Thanks a ton @vinothkannans I’ve just checked and your fix works flawlessly. If the setting `set_group_as_primary` is already enabled, just disable and re-enable it for the group and the flairs would be set for all the group members.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [October 29, 2021, 6:27am UTC](https://meta.discourse.org/t/group-avatar-flair-doesnt-apply-to-existing-members/206210/12 "2021-10-29T06:27:40Z")

</div>


