diff --git a/rating_api/models/db.py b/rating_api/models/db.py index 52a7ff2..58e3a5f 100644 --- a/rating_api/models/db.py +++ b/rating_api/models/db.py @@ -49,8 +49,8 @@ def search_by_name(self, query: str) -> bool: def search_by_subject(self, query: str) -> bool: query = query.lower() response = true - if query != "": - response = and_(Comment.review_status == ReviewStatus.APPROVED, func.lower(Comment.subject) == query) + if query: + response = and_(Comment.review_status == ReviewStatus.APPROVED, func.lower(Comment.subject).contains(query)) return response