def add_user_to_mailchimp(sender, instance, created, **kwargs): if instance.on_mailing_list: subscribe_user_to_mailer(instance)
def test_subscribe_user_to_mailer(self, _mocked_post): _mocked_post.return_value = Exception() _mocked_post.side_effect = Exception() out = subscribe_user_to_mailer(self.profile) self.assertFalse(out)
def add_subscriber(modeladmin, request, queryset): for prof in queryset: subscribe_user_to_mailer(prof)
def add_user_to_mailchimp(sender, instance, created, **kwargs): subscribe_user_to_mailer(instance)