Skip to content

Commit

Permalink
walkthroughs: fix walkthroughs bar
Browse files Browse the repository at this point in the history
  • Loading branch information
rr- committed Aug 8, 2023
1 parent 87d624c commit 88cb99a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion backend/trcustoms/config/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class GlobalStatsSerializer(serializers.Serializer):
total_walkthroughs = serializers.IntegerField()
total_downloads = serializers.IntegerField()
reviews = ReviewStatSerializer(many=True)
walkthroughs = WalkthroughStatSerializer(many=True)
walkthroughs = WalkthroughStatSerializer()


class ConfigSerializer(serializers.Serializer):
Expand Down
12 changes: 5 additions & 7 deletions backend/trcustoms/config/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@

def get_walkthrough_stats() -> dict[str, int]:
qs = Level.objects.filter(is_approved=True)
return (
dict(
video_and_text=qs.with_both_walkthroughs().count(),
video=qs.with_video_only_walkthroughs().count(),
text=qs.with_text_only_walkthroughs().count(),
none=qs.with_no_walkthroughs().count(),
),
return dict(
video_and_text=qs.with_both_walkthroughs().count(),
video=qs.with_video_only_walkthroughs().count(),
text=qs.with_text_only_walkthroughs().count(),
none=qs.with_no_walkthroughs().count(),
)


Expand Down

0 comments on commit 88cb99a

Please sign in to comment.