Hi,
I validate my contact form through Django's form validation framework.
The SMTPSenderRefused exception, however, is not caught in the
validation process. Now I would like to
try:
send_mail(form.cleaned_data['subject'],
form.cleaned_data['message'], form.cleaned_data['sender'],
[recipient], fail_silently=False)
return render_to_response('thanks.html', { 'current_site' :
Site.determine_site(request), 'title' : 'Thanks!' })
except AttributeError, SMTPSenderRefused:
# set the invalid error for sender when SMTPSenderRefused was
raised
return render_to_response('contact.html', { 'current_site' :
Site.determine_site(request), 'title' : 'Kontakt', 'form' : form })
The field errors seem to be r/o. Is there a way around this?
Thanks,
Jan
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---