feat(gamification): expand badge tiers and count only outgoing likes

This commit is contained in:
2026-10-02 13:00:49 +03:30
parent f496474014
commit ba829055a5
5 changed files with 33 additions and 13 deletions

View File

@@ -155,7 +155,7 @@ def summary_for_user(user):
)
activity_counts = Counter()
active_effects = (
rows.values("effect_key", "activity")
rows.values("effect_key", "activity", "role")
.annotate(net_points=Sum("points"))
.filter(net_points__gt=0)
)
@@ -166,7 +166,7 @@ def summary_for_user(user):
activity_counts["posts"] += 1
elif effect["activity"] == "comment":
activity_counts["comments"] += 1
elif effect["activity"] == "like":
elif effect["activity"] == "like" and effect["role"] == "actor":
activity_counts["likes"] += 1
points_total = totals["points_total"] or 0