Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix( parsing no delivery option) #4294

Merged
merged 16 commits into from
Mar 18, 2025
5 changes: 3 additions & 2 deletions cg/apps/orderform/excel_orderform_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,8 @@ def get_data_delivery(self) -> str:
"""Determine the order_data delivery type"""

data_delivery: str = self.parse_data_delivery()

if data_delivery == "no_delivery":
return DataDelivery.NO_DELIVERY
try:
return DataDelivery(data_delivery)
except ValueError as error:
Expand All @@ -188,7 +189,6 @@ def parse_data_delivery(self) -> str:
data_deliveries: set[str] = {
sample.data_delivery or self.NO_VALUE for sample in self.samples
}

if len(data_deliveries) > 1:
raise OrderFormError(f"mixed 'Data Delivery' types: {', '.join(data_deliveries)}")

Expand Down Expand Up @@ -234,4 +234,5 @@ def parse_orderform(self, excel_path: str) -> None:
@staticmethod
def _transform_data_delivery(data_delivery: str) -> str:
"""Transforms the data-delivery parsed in the excel file, to the ones used in cg"""

return data_delivery.lower().replace(" + ", "-").replace(" ", "_")
Loading