From 89c533a86d2754666f0ca29e647d1c2073c28ab0 Mon Sep 17 00:00:00 2001 From: delcroip Date: Thu, 17 Oct 2024 16:29:27 +0200 Subject: [PATCH] naming --- policy/models.py | 16 ++++++++-------- policy/services.py | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/policy/models.py b/policy/models.py index 7c8586a..7db73ac 100644 --- a/policy/models.py +++ b/policy/models.py @@ -137,23 +137,23 @@ class Meta: from claim.models import Claim @receiver(post_save, sender=Claim) @receiver(post_delete, sender=Claim) - def clean_inquire_cache(sender, instance, *args, **kwagrs): - cache.delete(f'elegibility_{instance.insuree.family_id or instance.insuree.id}_*') + def clean_enquire_cache_claim(sender, instance, *args, **kwagrs): + cache.delete(f'eligibility_{instance.insuree.family_id or instance.insuree.id}_*') @receiver(post_save, sender=Product) @receiver(post_delete, sender=Product) -def clean_all_inquire_cache(sender, instance, *args, **kwagrs): - cache.delete(f'elegibility_*') +def clean_all_enquire_cache_product(sender, instance, *args, **kwagrs): + cache.delete(f'eligibility_*') @receiver(post_save, sender=Policy) @receiver(post_delete, sender=Policy) -def clean_all_inquire_cache(sender, instance, *args, **kwagrs): - cache.delete(f'elegibility_{instance.family_id}_*') +def clean_all_enquire_cache_policy(sender, instance, *args, **kwagrs): + cache.delete(f'eligibility_{instance.family_id}_*') @receiver(post_save, sender=Family) @receiver(post_delete, sender=Family) -def clean_all_inquire_cache(sender, instance, *args, **kwagrs): - cache.delete(f'elegibility_{instance.id}_*') \ No newline at end of file +def clean_all_enquire_cache_family(sender, instance, *args, **kwagrs): + cache.delete(f'eligibility_{instance.id}_*') \ No newline at end of file diff --git a/policy/services.py b/policy/services.py index d6bb6e9..3ba975c 100644 --- a/policy/services.py +++ b/policy/services.py @@ -738,7 +738,7 @@ def get_total_filter(category): ) # InsPol -> Policy -> Product -> dedrem - result = cache.get(f'elegibility_{insuree.family_id or insuree.id}_{insuree.id}') + result = cache.get(f'eligibility_{insuree.family_id or insuree.id}_{insuree.id}') if not result: result = InsureePolicy.objects \ .filter( @@ -816,7 +816,7 @@ def get_total_filter(category): ).order_by( '-expiry_date' ).first() - cache.set(f'elegibility_{insuree.family_id or insuree.id}_{insuree.id}', result, None) + cache.set(f'eligibility_{insuree.family_id or insuree.id}_{insuree.id}', result, None) if result is None: eligibility.total_admissions_left = 0