From 66539d373aea9c6748a364e4d03642f734204e99e5bcf2168434bc08b0f0e559 Mon Sep 17 00:00:00 2001 From: vladislav Date: Tue, 8 Sep 2026 04:41:20 -0400 Subject: [PATCH] feat --- tasks.ipynb | 13 +++++++++++++ tasks.py | 13 +++++++++++++ 2 files changed, 26 insertions(+) diff --git a/tasks.ipynb b/tasks.ipynb index a47bca3..d7e45fe 100644 --- a/tasks.ipynb +++ b/tasks.ipynb @@ -69,6 +69,19 @@ "outputs": [], "source": [ "async def notify_in_profile(item: NotifyItem):\n", + " user = await users_collection.find_one({'_id': ObjectId(str(item.user_id))},{'email':1})\n", + " login_link = f'{FULL_DOMAIN}/login/{await token_create(str(user['_id']), url=f'/profile')}'\n", + " if PROD:\n", + " email_task.notify.delay(user['email'], {\n", + " 'text': 'в личном кабинете',\n", + " 'list': [[]],\n", + " 'primary': {\n", + " 'href': login_link,\n", + " 'text': 'Войти и посмотреть'\n", + " },\n", + " 'title': 'новое уведомление',\n", + " 'login_link': login_link,\n", + " }, 'Уведомление', 'main.html')\n", " return await notify_collection.update_one(\n", " {\n", " \"user_id\": item.user_id,\n", diff --git a/tasks.py b/tasks.py index 533bdbe..996119a 100644 --- a/tasks.py +++ b/tasks.py @@ -12,6 +12,19 @@ import asyncio async def notify_in_profile(item: NotifyItem): + user = await users_collection.find_one({'_id': ObjectId(str(item.user_id))},{'email':1}) + login_link = f'{FULL_DOMAIN}/login/{await token_create(str(user['_id']), url=f'/profile')}' + if PROD: + email_task.notify.delay(user['email'], { + 'text': 'в личном кабинете', + 'list': [[]], + 'primary': { + 'href': login_link, + 'text': 'Войти и посмотреть' + }, + 'title': 'новое уведомление', + 'login_link': login_link, + }, 'Уведомление', 'main.html') return await notify_collection.update_one( { "user_id": item.user_id,