Skip to content

Commit

Permalink
Refactor contains_only_existing_samples to accept OrderWithCases and …
Browse files Browse the repository at this point in the history
…update get_ticket_status logic
  • Loading branch information
eliottBo committed Jan 23, 2025
1 parent dbd8bf1 commit 93b5448
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions cg/meta/orders/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def get_ticket_tags(order: Order, order_type: OrderType) -> list[str]:
return tags


def contains_only_existing_samples(order: Order) -> bool:
def contains_only_existing_samples(order: OrderWithCases) -> bool:
"""Check if the order contains only existing samples"""

for enumerated_case in order.enumerated_cases:
Expand All @@ -41,7 +41,7 @@ def contains_only_existing_samples(order: Order) -> bool:

def get_ticket_status(order: Order) -> int:
"""Get the ticket status based on the order"""

if contains_only_existing_samples(order=order):
return Status.OPEN
if isinstance(order, OrderWithCases):
if contains_only_existing_samples(order=order):
return Status.OPEN
return Status.PENDING

0 comments on commit 93b5448

Please sign in to comment.