remove redundant check

(this is already checked using the 'if not self.condition_min_count or self.condition_min_value' condition directly above)
This commit is contained in:
Mira Weller
2024-07-18 11:17:16 +02:00
parent bee0eaa2fa
commit d1de8f5863

View File

@@ -274,9 +274,6 @@ class Discount(LoggedModel):
raise ValueError('Validation invariant violated.')
if self.benefit_only_apply_to_cheapest_n_matches:
if not self.condition_min_count:
raise ValueError('Validation invariant violated.')
# sort by line_price
condition_idx_group = sorted(condition_idx_group, key=lambda idx: (positions[idx].line_price_gross, -idx))
benefit_idx_group = sorted(benefit_idx_group, key=lambda idx: (positions[idx].line_price_gross, -idx))