fix
This commit is contained in:
parent
0e7b915deb
commit
803ab0a864
10
main.ipynb
10
main.ipynb
@ -4698,7 +4698,7 @@
|
||||
" \"page_title\": \"Доставка\",\n",
|
||||
" \"active_section\": \"delivery\"\n",
|
||||
" }\n",
|
||||
" )"
|
||||
" )\n"
|
||||
],
|
||||
"display_name": ".venv"
|
||||
},
|
||||
@ -4828,7 +4828,7 @@
|
||||
" posts = [doc async for doc in posts_collection.find().sort('_id', -1).limit(32)]\n",
|
||||
" return templates.TemplateResponse(\n",
|
||||
" request=request, name=\"profile/partner/exhibition catalog.html\", context={\"now\": datetime.now(), \"user\": user, \"galerists\": galerists, \"genres\": genres, \"living_places\": living_places, \"exhibition\": exhibition, \"posts\": posts}\n",
|
||||
" )"
|
||||
" )\n"
|
||||
],
|
||||
"display_name": ".venv"
|
||||
},
|
||||
@ -4851,8 +4851,8 @@
|
||||
" d_posts = await delivery_collection.find({'post_id':{'$in':[str(i.get('_id')) for i in posts]}}).to_list()\n",
|
||||
" for post in posts:\n",
|
||||
" for doc in d_posts:\n",
|
||||
" if str(post.get('_id')) == doc.get('post_id'):\n",
|
||||
" post.update({'status':doc.get('status'), 'd_id':doc.get('_id')})\n",
|
||||
" if str(post.get('_id')) == doc.get('post_id') and doc.get('receiver') and doc.get('receiver').get('_id') == str(user.get('_id')):\n",
|
||||
" post.update({'status':doc.get('status'), 'receiver': doc.get('receiver'), 'd_id':doc.get('_id')})\n",
|
||||
" return templates.TemplateResponse(\n",
|
||||
" request=request, name=\"profile/partner/exhibition.html\", context={\"now\": datetime.now(), \"user\": user, \"exhibition\": exhibition, \"posts\": posts}\n",
|
||||
" )\n",
|
||||
@ -4866,7 +4866,7 @@
|
||||
" data = await exhibition_collection.find({'user._id': user.get('_id')}).sort('_id', -1).to_list()\n",
|
||||
" return templates.TemplateResponse(\n",
|
||||
" request=request, name=\"profile/partner/exhibitions.html\", context={\"now\": datetime.now(), \"user\": user, \"data\": data}\n",
|
||||
" )"
|
||||
" )\n"
|
||||
],
|
||||
"display_name": ".venv"
|
||||
},
|
||||
|
||||
8
main.py
8
main.py
@ -3588,6 +3588,7 @@ async def profile_delivery(
|
||||
}
|
||||
)
|
||||
|
||||
|
||||
@app.post("/api/exhibition/send/invitations")
|
||||
async def api_exhibition_send_invitations(
|
||||
background_tasks: BackgroundTasks,
|
||||
@ -3693,6 +3694,7 @@ async def profile_partner_exhibitions_catalog(
|
||||
request=request, name="profile/partner/exhibition catalog.html", context={"now": datetime.now(), "user": user, "galerists": galerists, "genres": genres, "living_places": living_places, "exhibition": exhibition, "posts": posts}
|
||||
)
|
||||
|
||||
|
||||
@app.get("/profile/partner/exhibition/{exhibition_id}", response_class=HTMLResponse)
|
||||
async def profile_partner_exhibitions(
|
||||
request: Request,
|
||||
@ -3705,8 +3707,8 @@ async def profile_partner_exhibitions(
|
||||
d_posts = await delivery_collection.find({'post_id':{'$in':[str(i.get('_id')) for i in posts]}}).to_list()
|
||||
for post in posts:
|
||||
for doc in d_posts:
|
||||
if str(post.get('_id')) == doc.get('post_id'):
|
||||
post.update({'status':doc.get('status'), 'd_id':doc.get('_id')})
|
||||
if str(post.get('_id')) == doc.get('post_id') and doc.get('receiver') and doc.get('receiver').get('_id') == str(user.get('_id')):
|
||||
post.update({'status':doc.get('status'), 'receiver': doc.get('receiver'), 'd_id':doc.get('_id')})
|
||||
return templates.TemplateResponse(
|
||||
request=request, name="profile/partner/exhibition.html", context={"now": datetime.now(), "user": user, "exhibition": exhibition, "posts": posts}
|
||||
)
|
||||
@ -3720,4 +3722,4 @@ async def profile_exhibitions(
|
||||
data = await exhibition_collection.find({'user._id': user.get('_id')}).sort('_id', -1).to_list()
|
||||
return templates.TemplateResponse(
|
||||
request=request, name="profile/partner/exhibitions.html", context={"now": datetime.now(), "user": user, "data": data}
|
||||
)
|
||||
)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user