Skip to content

Commit

Permalink
Finish feature/OPL-68
Browse files Browse the repository at this point in the history
OPL-68 Add signal bindings for Subscription handling
  • Loading branch information
dragos-dobre committed Apr 4, 2022
2 parents 7170f12 + afc83a5 commit fd90946
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions insuree/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
from django.db.models import Q
from django.utils.translation import gettext as _

from core.signals import register_service_signal
from insuree.apps import InsureeConfig
from insuree.models import InsureePhoto, PolicyRenewalDetail, Insuree, Family, InsureePolicy

Expand Down Expand Up @@ -164,6 +165,7 @@ class InsureeService:
def __init__(self, user):
self.user = user

@register_service_signal('insuree_service.create_or_update')
def create_or_update(self, data):
photo = data.pop('photo', None)
from core import datetime
Expand Down Expand Up @@ -207,6 +209,7 @@ def remove(self, insuree):
'detail': insuree.uuid}]
}

@register_service_signal('insuree_service.delete')
def set_deleted(self, insuree):
try:
insuree.delete_history()
Expand Down

0 comments on commit fd90946

Please sign in to comment.