def alert_editor_of_newclient(sender, user, request, **kwargs): subject = 'New Client Signup' client_email = user.email recipients = [] for profile in UserProfile.objects.filter(user_type = 'Editor'): recipients.append(profile.user.email) new_client_alert.delay(settings.DEFAULT_FROM_EMAIL, recipients, subject, client_email)
def alert_editor_of_newclient(sender, user, request, **kwargs): subject = 'New Client Signup' client_email = user.email recipients = [] for profile in UserProfile.objects.filter(user_type='Editor'): recipients.append(profile.user.email) new_client_alert.delay(settings.DEFAULT_FROM_EMAIL, recipients, subject, client_email)
def test_new_client_alert_task(self): subject = 'New Client Signup' text = '*****@*****.**' sender = settings.DEFAULT_FROM_EMAIL recipients = [] for profile in UserProfile.objects.filter(user_type = 'Editor'): recipients.append(profile.user.email) result = new_client_alert.delay(recipients, text) self.assertTrue(result.successful())
def alert_editor_of_newclient(sender, user, request, **kwargs): client_email = user.email recipients = [] for profile in UserProfile.objects.filter(user_type = 'Editor'): recipients.append(profile.user.email) new_client_alert.delay(recipients, client_email)