-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
FIX get_students caching on all user query
- Loading branch information
Showing
3 changed files
with
12 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,27 @@ | ||
from typing import List | ||
from flask import Blueprint | ||
|
||
from flask import Blueprint | ||
|
||
from anubis.lms.courses import assert_course_context, assert_course_superuser, course_context | ||
from anubis.lms.repos import get_repos | ||
from anubis.lms.students import get_students | ||
from anubis.lms.theia import get_recent_sessions | ||
from anubis.models import Assignment, Course, InCourse, Submission, User, db | ||
from anubis.utils.auth.http import require_admin, require_superuser | ||
from anubis.utils.auth.user import current_user | ||
from anubis.utils.data import req_assert | ||
from anubis.utils.http import get_number_arg, success_response | ||
from anubis.utils.http.decorators import json_endpoint, json_response | ||
from anubis.utils.auth.http import require_superuser | ||
from anubis.utils.http import success_response | ||
from anubis.utils.http.decorators import json_response | ||
|
||
students_ = Blueprint("super-students", __name__, url_prefix="/super/students") | ||
|
||
|
||
@students_.route("/list") | ||
@require_superuser() | ||
@json_response | ||
def admin_students_list(): | ||
def super_students_list(): | ||
""" | ||
List all users within the current course context | ||
:return: | ||
""" | ||
|
||
# Get all students | ||
students = [s.data for s in User.query.all()] | ||
students = get_students(None) | ||
|
||
# Pass back the students | ||
return success_response({"students": students}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters