]> git.parisson.com Git - teleforma.git/commitdiff
Fix professor not appearing in admin script correctors list https://trackers.pilotsys...
authorYoan Le Clanche <yoanl@pilotsystems.net>
Thu, 10 Feb 2022 12:06:23 +0000 (13:06 +0100)
committerYoan Le Clanche <yoanl@pilotsystems.net>
Thu, 10 Feb 2022 12:06:23 +0000 (13:06 +0100)
teleforma/exam/admin.py

index c1dd5484837377b4d03b8216f4a7773052d533bd..e7354af793d9784832afaf700871485135d80bce 100644 (file)
@@ -55,7 +55,7 @@ class ScriptAdmin(admin.ModelAdmin):
 
 
     def render_change_form(self, request, context, *args, **kwargs):
-         context['adminform'].form.fields['corrector'].queryset = User.objects.filter(is_active=True).filter(Q(corrector__isnull=False) | Q(is_superuser=True) | Q(corrector__isnull=False))
+         context['adminform'].form.fields['corrector'].queryset = User.objects.filter(is_active=True).filter(Q(corrector__isnull=False) | Q(is_superuser=True) | Q(professor__isnull=False)).order_by('last_name')
          return super(ScriptAdmin, self).render_change_form(request, context, *args, **kwargs)
 
     def author_name(self, instance):