From f776d6ce253e74aa00f48f9c04f24600d3c84da134c056ad666cef7b21d40ff7 Mon Sep 17 00:00:00 2001 From: vladislav Date: Mon, 14 Sep 2026 06:59:06 -0400 Subject: [PATCH] fix --- main.ipynb | 4 ++-- main.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.ipynb b/main.ipynb index 5a85ded..978aa16 100644 --- a/main.ipynb +++ b/main.ipynb @@ -4998,8 +4998,8 @@ " \n", " data = [doc async for doc in get_delivery_aggregate(_match)]\n", "\n", - " exhibitions = await exhibition_collection.find({'_id': {'$in': [ObjectId(i.get('exhibition_id')) for i in data if i.get('exhibition_id')]}}).to_list()\n", - " competitions = await competitions_col.find({'_id': {'$in': [i.get('competition_id') for i in data if i.get('competition_id')]}}).to_list()\n", + " exhibitions = await exhibition_collection.find({'_id': {'$in': [ObjectId(i.get('exhibition_id')) for i in data if i.get('exhibition_id')]}}).sort(\"_id\", -1).to_list()\n", + " competitions = await competitions_col.find({'_id': {'$in': [i.get('competition_id') for i in data if i.get('competition_id')]}}).sort(\"_id\", -1).to_list()\n", " return templates.TemplateResponse(\n", " request=request,\n", " name=\"profile/delivery.html\",\n", diff --git a/main.py b/main.py index fd3ab3c..9756cf0 100644 --- a/main.py +++ b/main.py @@ -3818,8 +3818,8 @@ async def profile_delivery( data = [doc async for doc in get_delivery_aggregate(_match)] - exhibitions = await exhibition_collection.find({'_id': {'$in': [ObjectId(i.get('exhibition_id')) for i in data if i.get('exhibition_id')]}}).to_list() - competitions = await competitions_col.find({'_id': {'$in': [i.get('competition_id') for i in data if i.get('competition_id')]}}).to_list() + exhibitions = await exhibition_collection.find({'_id': {'$in': [ObjectId(i.get('exhibition_id')) for i in data if i.get('exhibition_id')]}}).sort("_id", -1).to_list() + competitions = await competitions_col.find({'_id': {'$in': [i.get('competition_id') for i in data if i.get('competition_id')]}}).sort("_id", -1).to_list() return templates.TemplateResponse( request=request, name="profile/delivery.html",