From 40a185f437ced3fc55948066f4d8cf1830dc5b93 Mon Sep 17 00:00:00 2001 From: Yan Wong Date: Tue, 16 Apr 2024 12:27:00 +0100 Subject: [PATCH] Fix finding banned without a join --- controllers/manage.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/controllers/manage.py b/controllers/manage.py index b2bb3f71..cc7afccb 100755 --- a/controllers/manage.py +++ b/controllers/manage.py @@ -855,13 +855,14 @@ def SET_PRICES(): } prev = band if prev is not None: - assert bands[prev].price is None # Check the last has no price set - queries[prev] = db(db.banned.ott) # And set that to the banned list + assert bands[prev].price is None # Check the last has no price set (and ban) + banned = db()._select(db.banned.ott) + queries[prev] = db(db.ordered_leaves.ott.belongs(banned)) #save the results db.prices.truncate() for band in sorted(bands): - num=queries[band].count() + num = queries[band].count() db.prices.insert( quantile=(float(cutoffs[band][0]) if band in cutoffs else None), n_leaves=num,