fixed full deals
This commit is contained in:
44
app/mongo.py
44
app/mongo.py
@ -334,20 +334,32 @@ async def additional_deals_data(*deals: dict, full: bool):
|
||||
|
||||
|
||||
async def get_all_summaries(full: bool):
|
||||
deals = await deals_collection.find({
|
||||
"$and": [
|
||||
{
|
||||
"$or": [
|
||||
{"isDeleted": False},
|
||||
{"isDeleted": {"$exists": False}}
|
||||
]
|
||||
},
|
||||
{
|
||||
"$or": [
|
||||
{"isCompleted": False},
|
||||
{"isCompleted": {"$exists": False}}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {"_id": False}).sort("id", asc).to_list()
|
||||
if not full:
|
||||
deals = await deals_collection.find({
|
||||
"$and": [
|
||||
{
|
||||
"$or": [
|
||||
{"isDeleted": False},
|
||||
{"isDeleted": {"$exists": False}}
|
||||
]
|
||||
},
|
||||
{
|
||||
"$or": [
|
||||
{"isCompleted": False},
|
||||
{"isCompleted": {"$exists": False}}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {"_id": False}).sort("id", asc).to_list()
|
||||
else:
|
||||
deals = await deals_collection.find({
|
||||
"$and": [
|
||||
{
|
||||
"$or": [
|
||||
{"isDeleted": False},
|
||||
{"isDeleted": {"$exists": False}}
|
||||
]
|
||||
}
|
||||
]
|
||||
}, {"_id": False}).sort("id", asc).to_list()
|
||||
return await additional_deals_data(*deals, full=full)
|
||||
|
||||
Reference in New Issue
Block a user