From 56651e0e0c6b6c13ca23145d2c411a0f1a54866b Mon Sep 17 00:00:00 2001 From: cuom1999 Date: Wed, 15 Feb 2023 17:22:37 -0600 Subject: [PATCH] Make submission data consistent --- judge/views/submission.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/judge/views/submission.py b/judge/views/submission.py index ac33ff9..92afb77 100644 --- a/judge/views/submission.py +++ b/judge/views/submission.py @@ -828,7 +828,16 @@ class AllSubmissions(GeneralSubmissions): result = cache.get(key) if result: return result - result = super(AllSubmissions, self)._get_result_data() + queryset = Submission.objects + if self.selected_languages: + queryset = queryset.filter(language__in=self.selected_languages) + if self.selected_statuses: + submission_results = [i for i, _ in Submission.RESULT] + if self.selected_statuses[0] in submission_results: + queryset = queryset.filter(result__in=self.selected_statuses) + else: + queryset = queryset.filter(status__in=self.selected_statuses) + result = get_result_data(queryset) cache.set(key, result, self.stats_update_interval) return result