Skip to content

Commit 053b758

Browse files
authored
Update case service to return only lists for get_participants (Netflix#4219)
Changed return type to be only a list for get_participants, but allow participants list to be empty.
1 parent c6fb835 commit 053b758

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/dispatch/case/service.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def delete(*, db_session, case_id: int):
373373

374374
def get_participants(
375375
*, db_session: Session, case_id: int, minimal: bool = False
376-
) -> list[Participant] | None:
376+
) -> list[Participant]:
377377
"""Returns a list of participants based on the given case id."""
378378
if minimal:
379379
case = (
@@ -390,4 +390,4 @@ def get_participants(
390390
.first()
391391
)
392392

393-
return case.participants if case else None
393+
return [] if case is None or case.participants is None else case.participants

0 commit comments

Comments
 (0)