Skip to content

Commit

Permalink
Fix archived orders in orders list
Browse files Browse the repository at this point in the history
Signed-off-by: alfred richardsn <rchrdsn@protonmail.ch>
  • Loading branch information
r4rdsn committed Jun 17, 2020
1 parent fe93427 commit a7fa6bb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/handlers/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,14 @@ async def aggregate_orders(buy: str, sell: str) -> typing.Tuple[Cursor, int]:
async def orders_button(call: types.CallbackQuery):
"""React to left/right button query in order book."""
query = {
"$or": [
{"expiration_time": {"$exists": False}},
{"expiration_time": {"$gt": time()}},
"$and": [
{
"$or": [
{"expiration_time": {"$exists": False}},
{"expiration_time": {"$gt": time()}},
]
},
{"$or": [{"archived": {"$exists": False}}, {"archived": False}]},
]
}
cursor = database.orders.find(query).sort("start_time", pymongo.DESCENDING)
Expand Down

0 comments on commit a7fa6bb

Please sign in to comment.