Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OPL-68 Add signal bindings for Subscription handling #34

Merged
merged 1 commit into from
Apr 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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