from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.core.files.uploadedfile import UploadedFile
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.core.files.uploadedfile import UploadedFile
body.setdefault(f.form_tag, []).append(sub_body)
contact = Contact.objects.create(
body.setdefault(f.form_tag, []).append(sub_body)
contact = Contact.objects.create(
ip=request.META['REMOTE_ADDR'],
contact=self.cleaned_data['contact'],
form_tag=self.form_tag)
ip=request.META['REMOTE_ADDR'],
contact=self.cleaned_data['contact'],
form_tag=self.form_tag)
'site_domain': getattr(self, 'site_domain', site.domain),
'contact': contact,
}
'site_domain': getattr(self, 'site_domain', site.domain),
'contact': contact,
}
mail_managers_subject = render_to_string([
'contact/%s/mail_managers_subject.txt' % self.form_tag,
'contact/mail_managers_subject.txt',
mail_managers_subject = render_to_string([
'contact/%s/mail_managers_subject.txt' % self.form_tag,
'contact/mail_managers_subject.txt',
mail_managers_body = render_to_string([
'contact/%s/mail_managers_body.txt' % self.form_tag,
'contact/mail_managers_body.txt',
mail_managers_body = render_to_string([
'contact/%s/mail_managers_body.txt' % self.form_tag,
'contact/mail_managers_body.txt',
mail_subject = render_to_string([
'contact/%s/mail_subject.txt' % self.form_tag,
'contact/mail_subject.txt',
mail_subject = render_to_string([
'contact/%s/mail_subject.txt' % self.form_tag,
'contact/mail_subject.txt',
if self.result_page:
mail_body = render_to_string(
'contact/%s/results_email.txt' % contact.form_tag,
{
'contact': contact,
'results': self.results(contact),
if self.result_page:
mail_body = render_to_string(
'contact/%s/results_email.txt' % contact.form_tag,
{
'contact': contact,
'results': self.results(contact),
else:
mail_body = render_to_string([
'contact/%s/mail_body.txt' % self.form_tag,
'contact/mail_body.txt',
else:
mail_body = render_to_string([
'contact/%s/mail_body.txt' % self.form_tag,
'contact/mail_body.txt',
send_mail(mail_subject, mail_body, 'no-reply@%s' % site.domain, [contact.contact], fail_silently=True)
return contact
send_mail(mail_subject, mail_body, 'no-reply@%s' % site.domain, [contact.contact], fail_silently=True)
return contact