This commit is contained in:
vladislav 2026-09-01 10:25:19 -04:00
parent f4f981233b
commit 58316d87ec
Signed by: Vladislav
GPG Key ID: D97C9E5E4860EE45
2 changed files with 10 additions and 0 deletions

View File

@ -4948,6 +4948,11 @@
"\n", "\n",
" galerists = [{\"_id\": uname, \"count\": counts_by_username.get(uname, '')} for uname in usernames]\n", " galerists = [{\"_id\": uname, \"count\": counts_by_username.get(uname, '')} for uname in usernames]\n",
" posts = [doc async for doc in posts_collection.find().sort('_id', -1).limit(32)]\n", " posts = [doc async for doc in posts_collection.find().sort('_id', -1).limit(32)]\n",
" 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') 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", " 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", " 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" " )\n"

View File

@ -3802,6 +3802,11 @@ async def profile_partner_exhibitions_catalog(
galerists = [{"_id": uname, "count": counts_by_username.get(uname, '')} for uname in usernames] galerists = [{"_id": uname, "count": counts_by_username.get(uname, '')} for uname in usernames]
posts = [doc async for doc in posts_collection.find().sort('_id', -1).limit(32)] posts = [doc async for doc in posts_collection.find().sort('_id', -1).limit(32)]
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') 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( return templates.TemplateResponse(
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} 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}
) )