From: yleclanche Date: Mon, 12 Aug 2019 14:49:22 +0000 (+0200) Subject: Fix crash when there are more than 61 quotas "MariaDB can only use 61 tables in a... X-Git-Tag: 1.4.1~16 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=84389cd4407ba23e7f441dae1dd1ce4b57a367c2;p=teleforma.git Fix crash when there are more than 61 quotas "MariaDB can only use 61 tables in a join" --- diff --git a/teleforma/views/crfpa.py b/teleforma/views/crfpa.py index 104b47a4..8b7da0eb 100644 --- a/teleforma/views/crfpa.py +++ b/teleforma/views/crfpa.py @@ -66,10 +66,11 @@ def get_crfpa_courses(user, date_order=False, num_order=False, period=None): types=CourseType.objects.all()) elif quotas and not user.is_staff: - queryset = Course.objects.all() + corrector_courses = set() for quota in quotas: - queryset = queryset.filter(quotas=quota) - courses = format_courses(courses, queryset=queryset, + corrector_courses.add(quota.course) + for course in corrector_courses: + courses = format_courses(courses, course=course, types=CourseType.objects.all()) elif student: