feat(gamification): expand badge tiers and count only outgoing likes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user