From 469293d2d061bb3c98f3197045fe86cfddf22db1 Mon Sep 17 00:00:00 2001 From: orertrr Date: Tue, 25 Jun 2024 16:00:23 +0800 Subject: [PATCH] fix: exclude disabled dispenses when getting my expenses Signed-off-by: orertrr --- module/dispense.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/module/dispense.py b/module/dispense.py index 7e71ba5..06e2d23 100644 --- a/module/dispense.py +++ b/module/dispense.py @@ -94,7 +94,10 @@ def get_by_ids(ids: list[str]) -> Cursor[dict[str, Any]]: Return the dispense data in `ids`. ''' - return DispenseDB().find({'_id': { '$in': ids }}) + return DispenseDB().find({ + '_id': { '$in': ids }, + 'enable': { '$eq': True } + }) @staticmethod def update(dispense_id: str, data: dict[str, Any]) -> dict[str, Any] | int: