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개의 좋아요

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

4개의 좋아요

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개의 좋아요

Merged in

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

Thank you @misaka4e21

5개의 좋아요