fix
This commit is contained in:
parent
d27263094a
commit
2b16ae3bb6
22
main.ipynb
22
main.ipynb
@ -4170,16 +4170,20 @@
|
||||
" user: Dict = Security(get_current_user)\n",
|
||||
"):\n",
|
||||
" data = await invitations_collection.find_one({'_id': ObjectId(invitation_id)})\n",
|
||||
" match_ = {\n",
|
||||
" \"$or\": [\n",
|
||||
" {\"sender._id\": user.get('_id')},\n",
|
||||
" {\"user._id\": user.get('_id')},\n",
|
||||
" {\"receiver._id\": user.get('_id')}\n",
|
||||
" ],\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",
|
||||
" cursor = delivery_collection.aggregate([\n",
|
||||
" {\"$match\": {\n",
|
||||
" \"$or\": [\n",
|
||||
" {\"sender._id\": user.get('_id')},\n",
|
||||
" {\"user._id\": user.get('_id')},\n",
|
||||
" {\"receiver._id\": user.get('_id')}\n",
|
||||
" ],\n",
|
||||
" 'prod': PROD,\n",
|
||||
" 'competition_id': data.get('competition').get('_id'),\n",
|
||||
" }},\n",
|
||||
" {\"$match\": match_},\n",
|
||||
" {\"$sort\": {\"_id\": -1}},\n",
|
||||
" {\"$group\": {\n",
|
||||
" \"_id\": \"$post_id\",\n",
|
||||
|
||||
22
main.py
22
main.py
@ -3185,16 +3185,20 @@ async def profile_invitation(
|
||||
user: Dict = Security(get_current_user)
|
||||
):
|
||||
data = await invitations_collection.find_one({'_id': ObjectId(invitation_id)})
|
||||
match_ = {
|
||||
"$or": [
|
||||
{"sender._id": user.get('_id')},
|
||||
{"user._id": user.get('_id')},
|
||||
{"receiver._id": user.get('_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": {
|
||||
"$or": [
|
||||
{"sender._id": user.get('_id')},
|
||||
{"user._id": user.get('_id')},
|
||||
{"receiver._id": user.get('_id')}
|
||||
],
|
||||
'prod': PROD,
|
||||
'competition_id': data.get('competition').get('_id'),
|
||||
}},
|
||||
{"$match": match_},
|
||||
{"$sort": {"_id": -1}},
|
||||
{"$group": {
|
||||
"_id": "$post_id",
|
||||
|
||||
Loading…
Reference in New Issue
Block a user