diff --git a/lego/apps/lending/managers.py b/lego/apps/lending/managers.py index 375865db2a..213de36d5f 100644 --- a/lego/apps/lending/managers.py +++ b/lego/apps/lending/managers.py @@ -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")