# Problemen met badges, titels en trust\_levels na reset van TL-systeem

**URL:** https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571
**Category:** Support
**Tags:** badges, trust-levels
**Created:** [4 april 2023 om 18:04 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571 "2023-04-04T18:04:33Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [4 april 2023 om 18:04 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571/1 "2023-04-04T18:04:33Z")

</div>

We updated our trust\_levels unlocking them all and we see that users stills having old ~~icons~~ titles.

> I friendly suggest to **disabling users to use trust\_levels badges unless their have the required trust\_level** to display them.

I think Badges needs to be dynamic because trust\_level system is dynamic.

_That simple modification will solve the problem we are facing, and probably more admins because it’s very common that users ‘loose’ their TL over time._

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [5 april 2023 om 11:18 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571/2 "2023-04-05T11:18:59Z")

</div>

> [@satonotdead](#):
>
> we see that users stills having old icons (not groups)

By icon, do you mean flairs? What do you mean by “not groups”?

Could you share screenshots?

If I set a user to trust\_level\_3, which is a group having a flair icon, and the user profile flair is set to **none** , it automatically sets the tryst\_level\_3 icon nonetheless:

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/2/0/420a02dccdcd2f4b438c0e782f3d496cefb01e1a.png)

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [5 april 2023 om 16:19 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571/5 "2023-04-05T16:19:00Z")

</div>

Use this #Customization > Theme component it works along side of group flairs.

> [@Trust-Level Avatar Flair](https://meta.discourse.org/t/trust-level-avatar-flair/82656):
>
> This theme component allows an admin to add flair to user avatars based on the user’s trust level. Trust level flair displays anywhere on the site that you would normally see group flair. There are a few theme settings to adjust the position of the flair in relation to the avatar. Basic Examples (with group flair in place) There is also a bottom-right position that will either replace group flair or be replaced by group flair depending on how you set the “group flair always on top” …

It will put top tl achieved flair on Avatar pic.

I would remove custom flairs you added to TL groups.

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [6 april 2023 om 03:05 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571/6 "2023-04-06T03:05:15Z")

</div>

Thanks, I tried that plugin but it broke more than solve 😛

The issue is with **badges** because changing trust\_levels keeps the old badges on the tribe and that’s not very good.

Is an expected behavior?

---

<div class="post-metadata">

### Author: ![Heliosurge](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/heliosurge/32/571810_2.png) [@Heliosurge](https://meta.discourse.org/u/Heliosurge)
#### Post date: [6 april 2023 om 03:07 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571/7 "2023-04-06T03:07:56Z")

</div>

The badges if it is the flairs is there selectable…

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [6 april 2023 om 03:12 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571/8 "2023-04-06T03:12:31Z")

</div>

Yes, we want users can show the title (badge) of their top trust\_level reached.

The workaround is removing that and we want to show their contributions!

That probably can be reached unabling to select badges without having the trust level required to (that will keeps the titles OK).

> [@Canapin](#):
>
> Could you share screenshots?

Thanks for your reply. I just edited the OP for being more clear and I think I found the real issue here.

---

<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: [6 april 2023 om 05:07 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571/9 "2023-04-06T05:07:57Z")

</div>

> [@satonotdead](#):
>
> I think Badges needs to be dynamic because trust\_level system is dynamic.

I completely agree!

The status quo doesn’t make sense to me, as I only want the **current** trust level to be apparent in a badge collection. Ideally I’d like it to be the most obvious badge on the user card too (i.e. always displayed in the same prominent location), but not as in-your-face as an avatar flair.

I’ve achieved close to this by replacing the default trust badges with some custom ones that use SQL and revert automatically. Can share them if you like.

---

<div class="post-metadata">

### Author: ![mattdm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/mattdm/32/216484_2.png) [@mattdm](https://meta.discourse.org/u/mattdm)
#### Post date: [6 april 2023 om 05:18 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571/10 "2023-04-06T05:18:17Z")

</div>

> [@satonotdead](#):
>
> Yes, we want users can show the title (badge) of their top trust\_level reached.

I’m sorry, but I’m still not understanding. You started with “We updated our trust\_levels unlocking them all” — doesn’t that, by simple definition, mean that all users have reached TL4, the top trust level?

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [6 april 2023 om 05:23 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571/11 "2023-04-06T05:23:24Z")

</div>

> [@mattdm](#):
>
> I’m sorry, but I’m still not understanding. You started with “We updated our trust\_levels unlocking them all” — doesn’t that, by simple definition, mean that all users have reached TL4, the top trust level?

We had TL3 locked. So when we unlocked trust\_levels the majority went down (used Discord because people asked for it so almost no interaction on Discourse from a while).

> [@nathankershaw](#):
>
> I’ve achieved close to this by replacing the default trust badges with some custom ones that use SQL and revert automatically. Can share them if you like.

That could be a really good workaround. Please share it if you want!

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [6 april 2023 om 07:42 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571/12 "2023-04-06T07:42:40Z")

</div>

Some things happen as a result of regular background jobs. You might need to wait a day for changes in trust level to be reflected in the accounts.

With the default setup, people will enter and leave TL3. So it’s normal for a person to join the group and get the badge, and then later to leave the group and lose the badge - I think.

That is, the highest level achieved would be TL3, but if you lost TL3 because you became disengaged, you would normally lose all the signifiers that you ever had TL3. I think.

---

<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: [6 april 2023 om 19:56 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571/13 "2023-04-06T19:56:28Z")

</div>

> [@Ed\_S](#):
>
> That is, the highest level achieved would be TL3, but if you lost TL3 because you became disengaged, you would normally lose all the signifiers that you ever had TL3. I think.

You are correct - the SQL is visible in the ‘official’ badges and that is what it does. It also is set up to deliberately let the ‘lesser’ trust level badges hang around.

For example, here is the SQL for TL3:

```sql
SELECT u.id user_id, current_timestamp granted_at FROM users u
WHERE trust_level >= 3 AND (
  :backfill OR u.id IN (:user_ids)
)

```

As you can’t edit the SQL on ‘official’ badges, my workaround was to simply clone each official badge and change the `>=` to simply `=`. This ensures that only one badge is given (at least once the old one has been revoked overnight).

> [@satonotdead](#):
>
> titles.

I see now that this might be your actual problem - that the Titles remain on folk after they have lost their trust levels (and badges once revoked on the daily SQL check). I haven’t looked at this in detail to try and repro it, but have you unchecked “Allow badge to be used as title” for those?

> [@nathankershaw](#):
>
> Ideally I’d like it to be the most obvious badge on the user card too (i.e. always displayed in the same prominent location), but not as in-your-face as an avatar flair.

🎉 I note that this is sorted on the new User Card experiment here in Meta 🎉:

 ![image](https://global.discourse-cdn.com/meta/original/4X/4/3/0/43097dbd39ec4f7508806c4c5c91f4f8f46379d6.png)

That pretty much deals with the issue from my perspective. But it would be nice if it was also sorted on the `/u/username/summary`.

### P.S.

I’ve edited the title of the OP to reflect the focus more tightly. Had moved it to #Contribute > Feature but then realised that we aren’t actually clear on that (yet) - keep going!

---

<div class="post-metadata">

### Author: ![satonotdead](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/satonotdead/32/447830_2.png) [@satonotdead](https://meta.discourse.org/u/satonotdead)
#### Post date: [11 april 2023 om 16:02 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571/14 "2023-04-11T16:02:31Z")

</div>

> [@nathankershaw](#):
>
> I haven’t looked at this in detail to try and repro it, but have you unchecked “Allow badge to be used as title” for those?

Hi there, I don’t want this because I want people really having the trust level uses the title.

**Badges need to be in sync with trust levels. They need to get out of profiles when trust level is gone.**

---

<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: [11 april 2023 om 21:59 UTC](https://meta.discourse.org/t/badges-titles-and-trust-levels-problems-after-reset-of-tl-system/260571/15 "2023-04-11T21:59:07Z")

</div>

They are - it just isn’t instant (revokation only works overnight)

And if they aren’t disappearing for you at all then you might need to get into the rails console.

You might well need to do that to mop up any stray Titles out there too. Shouldn’t be too hard to identify them nor delete the content of the Title field for them.

I’d certainly prefer if the stock Badge queries were set up to revoke superceded badges (as per the SQL tweak above), but that is up to the Discourse [@team](https://meta.discourse.org/groups/team) of course.
