-# -*- coding: utf-8 -*-
+import json
from django.contrib.sites.models import Site
from django.core.exceptions import ValidationError
from django.core.files.uploadedfile import UploadedFile
from django.core.mail import send_mail, mail_managers
-from django.core.urlresolvers import reverse
from django.core.validators import validate_email
from django import forms
from django.template.loader import render_to_string
from django.template import RequestContext
+from django.urls import reverse
from django.utils.translation import ugettext_lazy as _
body.setdefault(f.form_tag, []).append(sub_body)
contact = Contact.objects.create(
- body=body,
+ body=json.dumps(body),
ip=request.META['REMOTE_ADDR'],
contact=self.cleaned_data['contact'],
form_tag=self.form_tag)