diff --git a/backend/project/endpoints/projects/projects.py b/backend/project/endpoints/projects/projects.py index 94813bbd..03d46112 100644 --- a/backend/project/endpoints/projects/projects.py +++ b/backend/project/endpoints/projects/projects.py @@ -62,7 +62,10 @@ def get(self, uid=None): projects = projects.filter(and_(*conditions)) if conditions else projects projects = projects.all() projects = [p for p in projects if get_course_of_project(p.project_id) in courses] - projects_student = Project.query.filter(Project.course_id.in_(courses_student)).all() + projects_student = Project.query.filter(Project.course_id.in_(courses_student)) + projects_student = projects_student.filter(and_(*conditions)) \ + if conditions else projects_student + projects_student = projects_student.all() projects_student = [p for p in projects_student if p.visible_for_students] projects += projects_student