Skip to content

Commit

Permalink
[#197] Fix school_information and query
Browse files Browse the repository at this point in the history
  • Loading branch information
wayangalihpratama committed Oct 8, 2024
1 parent 116e8b9 commit 075309b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/db/crud_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ def get_data_by_school(
session: Session, schools: List[str], year_conducted: Optional[int] = None
):
data = session.query(Data)
and_query = and_(Data.school_information.contains([v]) for v in schools)
and_query = and_(Data.school_information == schools)
data = data.filter(and_query)
if year_conducted:
data = data.filter(Data.year_conducted == year_conducted)
Expand All @@ -249,7 +249,7 @@ def get_history_data_by_school(
session: Session, schools: List[str], year_conducted: Optional[int] = None
):
data = session.query(Data)
and_query = and_(Data.school_information.contains([v]) for v in schools)
and_query = and_(Data.school_information == schools)
data = data.filter(and_query).filter(Data.current == false())
if year_conducted:
data = data.filter(Data.year_conducted < year_conducted)
Expand Down

0 comments on commit 075309b

Please sign in to comment.