feat
This commit is contained in:
parent
a7a03d321d
commit
d1d9c5e9de
@ -56,11 +56,15 @@ async def send_delivery(
|
||||
continue
|
||||
|
||||
# Уведомление получателю
|
||||
if (exhibition:=existing.get('exhibition',{})) and (exhibition_id:=existing.get('exhibition_id')):
|
||||
link = f'/profile/delivery/exhibition/{exhibition_id}'
|
||||
else:
|
||||
link = f'/profile/delivery'
|
||||
notify = await notify_in_profile(NotifyItem(
|
||||
user_id=str(existing["receiver"]["_id"]),
|
||||
type_item="delivery",
|
||||
title="Доставка картин",
|
||||
link="/profile/delivery",
|
||||
link=link,
|
||||
text=f"{str(existing['sender']['username'])} — прислал вам картины."
|
||||
))
|
||||
|
||||
@ -106,13 +110,16 @@ async def accept_delivery(
|
||||
if not existing:
|
||||
errors.append({"item": item_id, "error": "Доставка не найдена или не для вас"})
|
||||
continue
|
||||
|
||||
if (exhibition:=existing.get('exhibition',{})) and (exhibition_id:=existing.get('exhibition_id')):
|
||||
link = f'/profile/delivery/exhibition/{exhibition_id}'
|
||||
else:
|
||||
link = f'/profile/delivery'
|
||||
# Уведомление отправителю
|
||||
notify = await notify_in_profile(NotifyItem(
|
||||
user_id=str(existing["sender"]["_id"]),
|
||||
type_item="delivery",
|
||||
title="Доставка картин",
|
||||
link="/profile/delivery",
|
||||
link=link,
|
||||
text=f"Картина «{existing['title']}» получена — {str(existing['receiver']['username'])}."
|
||||
))
|
||||
|
||||
|
||||
11
tasks.ipynb
11
tasks.ipynb
@ -678,12 +678,15 @@
|
||||
" {'post_id': {'$in': other_ids}},\n",
|
||||
" {'$set': {'status': 'Приглашение отклонено'}} # как вы написали\n",
|
||||
" )\n",
|
||||
"\n",
|
||||
" if (exhibition:=invitation.get('exhibition',{})) and (exhibition_id:=invitation.get('exhibition_id')):\n",
|
||||
" link = f'/profile/delivery/exhibition/{exhibition_id}'\n",
|
||||
" else:\n",
|
||||
" link = f'/profile/delivery'\n",
|
||||
" await notify_in_profile(NotifyItem(\n",
|
||||
" user_id=invitation.get('exhibition',{}).get(\"user\",{}).get('_id'),\n",
|
||||
" user_id=exhibition.get(\"user\",{}).get('_id'),\n",
|
||||
" type_item='c',\n",
|
||||
" title=f'Выставка \"{invitation.get('exhibition',{}).get(\"title\")}\"',\n",
|
||||
" link=f'/profile/delivery',\n",
|
||||
" title=f'Выставка \"{exhibition.get(\"title\")}\"',\n",
|
||||
" link=link,\n",
|
||||
" text=f'Художник принял условия'\n",
|
||||
" ))"
|
||||
],
|
||||
|
||||
11
tasks.py
11
tasks.py
@ -516,12 +516,15 @@ async def accept_invitations(invitations_id: str, posts_ids: List[str]):
|
||||
{'post_id': {'$in': other_ids}},
|
||||
{'$set': {'status': 'Приглашение отклонено'}} # как вы написали
|
||||
)
|
||||
|
||||
if (exhibition:=invitation.get('exhibition',{})) and (exhibition_id:=invitation.get('exhibition_id')):
|
||||
link = f'/profile/delivery/exhibition/{exhibition_id}'
|
||||
else:
|
||||
link = f'/profile/delivery'
|
||||
await notify_in_profile(NotifyItem(
|
||||
user_id=invitation.get('exhibition',{}).get("user",{}).get('_id'),
|
||||
user_id=exhibition.get("user",{}).get('_id'),
|
||||
type_item='c',
|
||||
title=f'Выставка "{invitation.get('exhibition',{}).get("title")}"',
|
||||
link=f'/profile/delivery',
|
||||
title=f'Выставка "{exhibition.get("title")}"',
|
||||
link=link,
|
||||
text=f'Художник принял условия'
|
||||
))
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user