X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/10510d28f980e9a61bdd2b5471e78eec872952ba..e18d543fa8e2bd224880a79fb71ea8726b1d45bf:/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'), )