Remove obsolete jsonfield dependency.
[wolnelektury.git] / src / contact / forms.py
index 3cdf59d..ee44e4b 100644 (file)
@@ -1,13 +1,13 @@
-# -*- 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 _
 
 
@@ -57,7 +57,7 @@ class ContactForm(forms.Form):
                     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)