Skip to content

Commit

Permalink
Merge with develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Lyutillis committed Dec 18, 2023
2 parents cb250f4 + 6132193 commit ab18a54
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions borrowing_service/signals.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
@receiver(post_save, sender=Borrowing)
def notify_new_borrowing(sender, instance, created, **kwargs):
if created:
<<<<<<< HEAD
borrowing_info = (
"New borrowing created:\n\n"
f"-Book: {instance.book}\n"
Expand All @@ -20,3 +21,18 @@ def notify_new_borrowing(sender, instance, created, **kwargs):
TelegramUser.objects.get(user_id=instance.user.pk).chat_id,
borrowing_info
)
=======
try:
borrowing_info = (
"New borrowing created:\n\n"
f"-Book: {instance.book}\n"
f"--Borrow date: {instance.borrow_date}\n"
f"--Expected return date: {instance.expected_return_date}\n"
)
send_notification(
TelegramUser.objects.get(user_id=instance.user_id).chat_id,
borrowing_info
)
except TelegramUser.DoesNotExist:
pass
>>>>>>> 613219309799928dfc2b508eb819b8f5992cafd6

0 comments on commit ab18a54

Please sign in to comment.