Skip to content

Commit

Permalink
Rename function for clarity and update ticket tag generation logic to…
Browse files Browse the repository at this point in the history
… check for existing data in orders
  • Loading branch information
eliottBo committed Jan 23, 2025
1 parent 0af8611 commit 5fad3d0
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions cg/meta/orders/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from cg.services.orders.validation.models.order_with_cases import OrderWithCases


def does_order_contain_existing_data(order: OrderWithCases) -> bool:
def contains_existing_data(order: OrderWithCases) -> bool:
"""Check if the order contains any existing data"""

for enumerated_case in order.enumerated_cases:
Expand All @@ -21,7 +21,8 @@ def get_ticket_tags(order: Order, order_type: OrderType) -> list[str]:
tags: list[str] = []
tags.append(ORDER_TYPE_WORKFLOW_MAP[order_type])

if does_order_contain_existing_data(order=order):
tags.append("existing-data")
if isinstance(order, OrderWithCases):
if contains_existing_data(order=order):
tags.append("existing-data")

return tags

0 comments on commit 5fad3d0

Please sign in to comment.