X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/538526fc82b771cbc149743f129d8b1ae7e3cba2..c2e8051452fa55db096553cbe5ae622fc363d481:/src/isbn/forms.py?ds=sidebyside diff --git a/src/isbn/forms.py b/src/isbn/forms.py index 2acc34a8e..5f2940c2f 100644 --- a/src/isbn/forms.py +++ b/src/isbn/forms.py @@ -1,6 +1,6 @@ -# -*- coding: utf-8 -*- from datetime import date -from urllib2 import urlopen +import json +from urllib.request import urlopen from django import forms from django.utils.translation import ugettext_lazy as _ @@ -48,7 +48,7 @@ class WLConfirmForm(WLISBNForm): for file_format in data['formats']: data['product_form'] = PRODUCT_FORMS[file_format] data['product_form_detail'] = PRODUCT_FORM_DETAILS[file_format] - data['contributors'] = self.contributors(data) + data['contributors'] = json.dumps(self.contributors(data)) ONIXRecord.new_record(purpose=ISBNPool.PURPOSE_WL, data=data) return data @@ -93,7 +93,7 @@ class FNPISBNForm(forms.Form): 'title': self.cleaned_data['title'], 'language': self.cleaned_data['language'], 'publishing_date': self.cleaned_data['publishing_date'], - 'contributors': [self.prepare_author(a) for a in self.cleaned_data['authors'].split(',')], + 'contributors': json.dumps([self.prepare_author(a) for a in self.cleaned_data['authors'].split(',')]), 'edition_type': 'NED', 'imprint': 'Fundacja Nowoczesna Polska', 'dc_slug': self.slug(),