I am working on a form that takes a little data and throws it in a
database, but before all that jazz it sends an email to a list/tuple
of recipients. This is going very well except the send_mail process is
raising a very annoying and persistent error:

"to" argument must be a list or tuple

Here is the view:

def short_form(request):
    if request.method == 'POST':
        form = ArtistFormFinal(request.POST, request.FILES)
        if form.is_valid():
            name = form.cleaned_data['name']
            year_created = form.cleaned_data['year_created']
            home_city = form.cleaned_data['home_city']
            home_state = form.cleaned_data['home_state']
            genre = form.cleaned_data['genre']
            email_address = form.cleaned_data['email_address']
            phone_number = form.cleaned_data['phone_number']
            website = form.cleaned_data['website']
            audio = form.cleaned_data['audio_file']
            recipients = ['ntankers...@opubco.com']
            send_mail(name, year_created, home_city, home_state,
recipients)
            form.save()
            return HttpResponseRedirect('thanks')
    else:
        form = ArtistFormFinal()
    return render_to_response('static/artist_short.html',
{'form':form})

Now, it looks like it is getting hung up on recipients. This is a
tuple, one value. What am I missing here?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to