-# -*- 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 _
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
'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(),