Skip to content

Commit

Permalink
wip(summary-flows) Add additional filter
Browse files Browse the repository at this point in the history
  • Loading branch information
iwankrshkin committed Jun 7, 2024
1 parent 9a6138f commit c5b4b7b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/apps/answers/crud/answers.py
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,10 @@ async def get_submitted_flows_with_last_date(
subquery = subquery.where(AnswerSchema.target_subject_id == target_subject_id)

query: Query = select(AnswerSchema.flow_history_id, func.max(AnswerSchema.created_at))
query = query.where(AnswerSchema.submit_id.in_(subquery))
query = query.where(
AnswerSchema.submit_id.in_(subquery),
AnswerSchema.is_flow_completed.is_(True),
)
query = query.group_by(AnswerSchema.flow_history_id)
query = query.order_by(AnswerSchema.flow_history_id)
db_result = await self._execute(query)
Expand Down

0 comments on commit c5b4b7b

Please sign in to comment.