X-Git-Url: https://git.mdrn.pl/wolnelektury.git/blobdiff_plain/967eed676fc83d15b26149047f353ac61faa8217..1b80c204be885588f7cbe95610e3677f2f886801:/src/catalogue/management/commands/importbooks.py diff --git a/src/catalogue/management/commands/importbooks.py b/src/catalogue/management/commands/importbooks.py index b8a9aa7bf..e5e7c89fa 100644 --- a/src/catalogue/management/commands/importbooks.py +++ b/src/catalogue/management/commands/importbooks.py @@ -32,6 +32,10 @@ class Command(BaseCommand): '-S', '--no-search-index', action='store_false', dest='search_index', default=True, help='Skip indexing imported works for search') + parser.add_argument( + '-F', '--not-findable', action='store_false', + dest='findable', default=True, + help='Set book as not findable.') parser.add_argument( '-p', '--picture', action='store_true', dest='import_picture', default=False, help='Import pictures') @@ -46,7 +50,9 @@ class Command(BaseCommand): file_base, ext = os.path.splitext(file_path) book = Book.from_xml_file(file_path, overwrite=options.get('force'), dont_build=dont_build, - search_index_tags=False) + search_index_tags=False, + findable=options.get('findable'), + ) for ebook_format in Book.ebook_formats: if os.path.isfile(file_base + '.' + ebook_format): getattr(book, '%s_file' % ebook_format).save(