Count at "Others with this badge" includes current user

The page that is opened when a badge is granted shows a button “Others with this badge (X)”, where X denotes a number.

I’ve noticed that this number is incorrect in some cases in the sense that it also includes the current user and counts each occurrence of the badge.

As an example, lets say I’ve been just granted the “Hot Link” badge. The page shows two instances of the “Hot Link” badge (the current and a previously granted one). The button shows “Others with this badge (2)”. If I click on the button the very same badges are shown.

8 Likes

@misaka4e21 can you have a look at a simple fix here? We just need to -1 if you happen to have the badge.

4 Likes

I haven’t looked at the code, it’s probably -1 * n (where n is the number of times you got granted this badge).

2 Likes

Merged in

https://github.com/discourse/discourse/pull/6016

Thank you @misaka4e21

5 Likes