feat
This commit is contained in:
parent
002235b6f6
commit
66539d373a
13
tasks.ipynb
13
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",
|
||||
|
||||
13
tasks.py
13
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,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user