diff --git a/tinywiki/management/commands/twimport.py b/tinywiki/management/commands/twimport.py index dec5881..d565951 100644 --- a/tinywiki/management/commands/twimport.py +++ b/tinywiki/management/commands/twimport.py @@ -14,7 +14,7 @@ from ...utils import ( class Command(BaseCommand): - help = "Export wiki content for an app" + help = "Import wiki content for an app" def add_arguments(self, parser): parser.add_argument("file", nargs=1, type=str) @@ -25,7 +25,9 @@ class Command(BaseCommand): if not options['file']: raise CommandError("No file to import specified") - file = Path(options['file'][0]).resolve() + + file = Path(options['file']).resolve() + print(f"Importing from {file} ...") if not file.exists(): raise CommandError("File does not exist!") @@ -48,7 +50,6 @@ class Command(BaseCommand): except UserModel.DoesNotExist: raise CommandError(f"No user with email {email} exists.") - if zipfile.is_zipfile(file): with zipfile.ZipFile(file, "r") as zf: znames = zf.namelist()