X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/03715cba601c571ac35765daa5b6a97a004326cf..c65314d0db1d45ec00001b207e633072cb17c156:/src/catalogue/forms.py diff --git a/src/catalogue/forms.py b/src/catalogue/forms.py index 405ea7c48..f124f3170 100644 --- a/src/catalogue/forms.py +++ b/src/catalogue/forms.py @@ -2,7 +2,7 @@ # Copyright © Fundacja Nowoczesna Polska. See NOTICE for more information. # from django import forms -from django.utils.translation import ugettext_lazy as _ +from django.utils.translation import gettext_lazy as _ from catalogue.models import Book from waiter.models import WaitedFile @@ -16,6 +16,7 @@ class BookImportForm(forms.Form): book_xml = forms.CharField(required=False) gallery_url = forms.CharField(required=False) days = forms.IntegerField(required=False) + hidden = forms.BooleanField(required=False) def clean(self): from django.core.files.base import ContentFile @@ -31,7 +32,9 @@ class BookImportForm(forms.Form): def save(self, **kwargs): return Book.from_xml_file(self.cleaned_data['book_xml_file'], overwrite=True, remote_gallery_url=self.cleaned_data['gallery_url'], - days=self.cleaned_data['days'], **kwargs) + days=self.cleaned_data['days'], + findable=not self.cleaned_data['hidden'], + **kwargs) FORMATS = [(f, f.upper()) for f in Book.ebook_formats]