X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/73e3cc6c4b80f1afbfc78fc7ccd6f6cfc90b719c..22af332597f857ee4fe60ea2ebfd8723fd9d5da9:/apps/catalogue/forms.py diff --git a/apps/catalogue/forms.py b/apps/catalogue/forms.py index 2bf974d44..391e3e429 100644 --- a/apps/catalogue/forms.py +++ b/apps/catalogue/forms.py @@ -3,7 +3,6 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django import forms -from django.core.files.base import ContentFile from django.utils.translation import ugettext_lazy as _ from slughifi import slughifi @@ -17,6 +16,8 @@ class BookImportForm(forms.Form): book_xml = forms.CharField(required=False) def clean(self): + from django.core.files.base import ContentFile + if not self.cleaned_data['book_xml_file']: if self.cleaned_data['book_xml']: self.cleaned_data['book_xml_file'] = \ @@ -85,6 +86,7 @@ FORMATS = ( ('txt', 'TXT'), ('epub', 'EPUB'), ('daisy', 'DAISY'), + ('mobi', 'MOBI'), )