"Promoter" Badge broken?

It looks like the “Promoter” badge isn’t getting assigned properly, at least on our forum.

The SQL for it is:

SELECT u.id user_id, current_timestamp granted_at
FROM users u
WHERE u.id IN (
  SELECT invited_by_id
  FROM invites i
  JOIN users u2 ON u2.id = i.user_id
  WHERE i.deleted_at IS NULL AND u2.active AND u2.trust_level >= 0 AND not u2.blocked
  GROUP BY invited_by_id
  HAVING COUNT(*) > 1
) AND u.active AND NOT u.blocked AND u.id > 0 AND
  (:backfill OR u.id IN (:user_ids) )

The problem appears to be the HAVING COUNT(*) > 1… shouldn’t that be HAVING COUNT(*) >= 1? Requiring someone to have invited more than one person to get the Promoter badge seems strange.

3 Likes

It is @sam’s badge so he should respond.

Looks like a bug, will update the badge.

1 Like

fixed in:

https://github.com/discourse/discourse/commit/5b16adc0e83446542bf9e8656e0a8b4deeff5dc9

3 Likes