Exemple #1
0
def update_dsc_cache_on_enterprise_customer_update(sender, instance, **kwargs):
    """
        clears data_sharing_consent_needed cache after enable_data_sharing_consent flag is changed.
    """
    old_instance = sender.objects.filter(pk=instance.uuid).first()
    if old_instance:   # instance already exists, so it's updating.
        new_value = instance.enable_data_sharing_consent
        old_value = old_instance.enable_data_sharing_consent
        if new_value != old_value:
            kwargs = {'enterprise_customer_uuid': six.text_type(instance.uuid)}
            result = clear_enterprise_customer_data_consent_share_cache.apply_async(kwargs=kwargs)
            log.info(u"DSC: Created {task_name}[{task_id}] with arguments {kwargs}".format(
                task_name=clear_enterprise_customer_data_consent_share_cache.name,
                task_id=result.task_id,
                kwargs=kwargs,
            ))
Exemple #2
0
def update_dsc_cache_on_enterprise_customer_update(sender, instance, **kwargs):
    """
        clears data_sharing_consent_needed cache after enable_data_sharing_consent flag is changed.
    """
    old_instance = sender.objects.filter(pk=instance.uuid).first()
    if old_instance:   # instance already exists, so it's updating.
        new_value = instance.enable_data_sharing_consent
        old_value = old_instance.enable_data_sharing_consent
        if new_value != old_value:
            kwargs = {'enterprise_customer_uuid': instance.uuid}
            result = clear_enterprise_customer_data_consent_share_cache.apply_async(kwargs=kwargs)
            log.info(u"DSC: Created {task_name}[{task_id}] with arguments {kwargs}".format(
                task_name=clear_enterprise_customer_data_consent_share_cache.name,
                task_id=result.task_id,
                kwargs=kwargs,
            ))