def index(request): ''' Signals that the grader is ready and lists available courses. ''' courses = config.courses() if request.is_ajax(): return JsonResponse({ "ready": True, "courses": _filter_fields(courses, ["key", "name"]) }) return render(request, 'access/ready.html', { "courses": courses, "manager": 'gitmanager' in settings.INSTALLED_APPS, })
def index(request): ''' Signals that the grader is ready and lists available courses. ''' courses = [ course for course in config.courses() if has_read_access(request, course["key"]) ] if request.is_ajax(): return JsonResponse({ "ready": True, "courses": _filter_fields(courses, ["key", "name"]) }) return render(request, 'access/ready.html', { "courses": courses, })