diff --git a/leaderboards/services.py b/leaderboards/services.py index 2bc8423..3734fb1 100644 --- a/leaderboards/services.py +++ b/leaderboards/services.py @@ -119,6 +119,11 @@ def get_performance_total(score: Score, score_set: ScoreSet): unique_fields=["membership_id", "score_id"], ) + outdated_membershipscores = MembershipScore.objects.filter( + membership=membership + ).exclude(score_id__in=[score.id for score in scores]) + outdated_membershipscores.delete() + membership.score_count = len(membership_scores) membership.pp = calculate_pp_total(