'If form is valid, send notification to recipients'

def form_valid(self, form):

    count = 0
    notification_cls = form.cleaned_data['source']
    for obj in self.get_queryset().all():
        for recipient in self.get_object_recipients(obj):
            notification = notification_cls(context_object=obj, request=self.request, user=recipient)
            notification.send()
            count += 1
    if (count == 0):
        self.message_user('No    recipients    to    send    to', level=messages.ERROR)
    else:
        self.message_user('Queued    {0}    messages'.format(count))
    return HttpResponseRedirect(self.request.get_full_path())
