Skip to content

Commit

Permalink
Add notification on update of lending instance
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasdeluna committed Mar 12, 2024
1 parent e549314 commit 37e3a49
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lego/apps/lending/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ def create(self, *args, **kwargs):
notification.notify()

return lending_instance

def update(self, *args, **kwargs):
from lego.apps.lending.notifications import LendingInstanceNotification

lending_instance = super().update(*args, **kwargs)
notification = LendingInstanceNotification(
lending_instance=lending_instance,
user=lending_instance.created_by,
)
notification.notify()

return lending_instance


def get_queryset(self):
return super().get_queryset().select_related("created_by")
Expand Down

0 comments on commit 37e3a49

Please sign in to comment.