1
0
Fork 0
mirror of synced 2024-06-27 18:40:52 +12:00

refactor: call setup_django with the check_db attribute for the commands that actually need the database

This commit is contained in:
Cristian 2020-12-11 18:02:56 -05:00
parent 57d1a3d4e5
commit a57a5b6b83

View file

@ -63,7 +63,7 @@ def run_subcommand(subcommand: str,
if subcommand not in meta_cmds: if subcommand not in meta_cmds:
from ..config import setup_django from ..config import setup_django
setup_django(in_memory_db=subcommand in fake_db) setup_django(in_memory_db=subcommand in fake_db, check_db=subcommand in archive_cmds)
module = import_module('.archivebox_{}'.format(subcommand), __package__) module = import_module('.archivebox_{}'.format(subcommand), __package__)
module.main(args=subcommand_args, stdin=stdin, pwd=pwd) # type: ignore module.main(args=subcommand_args, stdin=stdin, pwd=pwd) # type: ignore