From 71a1e50fb3f7ed92b68fa638fc008d0bbf5c9f51 Mon Sep 17 00:00:00 2001 From: Artem Morozov Date: Wed, 30 Oct 2024 21:26:16 +0300 Subject: [PATCH] Fix GET lecturer with subject --- rating_api/routes/lecturer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rating_api/routes/lecturer.py b/rating_api/routes/lecturer.py index 3a10e38..eb3b770 100644 --- a/rating_api/routes/lecturer.py +++ b/rating_api/routes/lecturer.py @@ -138,7 +138,7 @@ async def get_lecturers( if "general" in order_by: result.lecturers.sort(key=lambda item: (item.mark_general is None, item.mark_general)) if subject: - result.lecturers = [lecturer for lecturer in result.lecturers if subject in lecturer.subjects] + result.lecturers = [lecturer for lecturer in result.lecturers if lecturer.subjects and subject in lecturer.subjects] result.total = len(result.lecturers) return result