This commit is contained in:
vladislav 2026-09-01 21:22:44 -04:00
parent 25cc63fe08
commit 5f6540815f
Signed by: Vladislav
GPG Key ID: D97C9E5E4860EE45
2 changed files with 4 additions and 18 deletions

View File

@ -1615,17 +1615,10 @@
" exhibition = await exhibition_collection.find_one({'_id': ObjectId(exhibition_id)})\n",
" if exhibition:\n",
" match_ = {\n",
" \"$or\": [\n",
" {\"sender._id\": user.get('_id')},\n",
" {\"user._id\": user.get('_id')},\n",
" {\"receiver._id\": user.get('_id')}\n",
" ],\n",
" \"exhibition_id\": exhibition_id,\n",
" 'prod': PROD,\n",
" }\n",
" if data.get('competition'):\n",
" match_.update({'competition_id': data.get('competition').get('_id')})\n",
" if data.get('exhibition_id'):\n",
" match_.update({'exhibition_id': data.get('exhibition_id')})\n",
"\n",
" cursor = delivery_collection.aggregate([\n",
" {\"$match\": match_},\n",
" {\"$sort\": {\"_id\": -1}},\n",

11
main.py
View File

@ -1202,17 +1202,10 @@ async def exhibition_members(
exhibition = await exhibition_collection.find_one({'_id': ObjectId(exhibition_id)})
if exhibition:
match_ = {
"$or": [
{"sender._id": user.get('_id')},
{"user._id": user.get('_id')},
{"receiver._id": user.get('_id')}
],
"exhibition_id": exhibition_id,
'prod': PROD,
}
if data.get('competition'):
match_.update({'competition_id': data.get('competition').get('_id')})
if data.get('exhibition_id'):
match_.update({'exhibition_id': data.get('exhibition_id')})
cursor = delivery_collection.aggregate([
{"$match": match_},
{"$sort": {"_id": -1}},