From 0338b927cf5f1cfb381fcb861708ad50e4439bcd Mon Sep 17 00:00:00 2001 From: Santiago Lamora Date: Thu, 22 Apr 2021 14:51:03 +0200 Subject: [PATCH] query.order_by is a tuple, update value to compare --- orchestra/contrib/plans/ratings.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/orchestra/contrib/plans/ratings.py b/orchestra/contrib/plans/ratings.py index ec8d9494..e55c7a27 100644 --- a/orchestra/contrib/plans/ratings.py +++ b/orchestra/contrib/plans/ratings.py @@ -65,7 +65,7 @@ def _standardize(rates): def step_price(rates, metric): - if rates.query.order_by != ['plan', 'quantity']: + if rates.query.order_by != ('plan', 'quantity'): raise ValueError("rates queryset should be ordered by 'plan' and 'quantity'") # Step price group = [] @@ -127,7 +127,7 @@ step_price.help_text = _("All rates with a quantity lower or equal than the metr def match_price(rates, metric): - if rates.query.order_by != ['plan', 'quantity']: + if rates.query.order_by != ('plan', 'quantity'): raise ValueError("rates queryset should be ordered by 'plan' and 'quantity'") candidates = [] selected = False @@ -159,7 +159,7 @@ match_price.help_text = _("Only the rate with a) inmediate inferior metri def best_price(rates, metric): - if rates.query.order_by != ['plan', 'quantity']: + if rates.query.order_by != ('plan', 'quantity'): raise ValueError("rates queryset should be ordered by 'plan' and 'quantity'") candidates = [] for plan, rates in rates.group_by('plan').items():