FIX verify_in_course returns course for superuser
@@ -88,6 +88,9 @@ def verify_in_course(course_id: str) -> Course:
from anubis.utils.http import req_assert
from anubis.models import InCourse
+ if current_user.is_superuser:
+ course: Course = Course.query.filter(Course.id == course_id).first()
+ else:
course: Course = Course.query.join(InCourse, InCourse.course_id == Course.id).filter(
InCourse.course_id == course_id, InCourse.owner_id == current_user.id
).first()
