From a1b49aeac0c932c54b06670ee2b35ea946d84f32 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 11 Jun 2013 18:31:55 +0200 Subject: Operations: work on import --- .../management/commands/import_operations.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'archaeological_operations/management/commands') diff --git a/archaeological_operations/management/commands/import_operations.py b/archaeological_operations/management/commands/import_operations.py index 0c842184b..a9ecf41c9 100755 --- a/archaeological_operations/management/commands/import_operations.py +++ b/archaeological_operations/management/commands/import_operations.py @@ -28,16 +28,16 @@ IMPORTERS = {'csv':import_from_csv, 'vfp':import_from_dbf} class Command(BaseCommand): - args = ' [ ]' + args = ' []' help = "Import archaelogical operations" def handle(self, *args, **options): if not args or not args[0]: raise CommandError("No file provided.") filename = args[0] - update = len(args) > 1 and args[1] - file_type = len(args) > 2 and args[2] - lines = len(args) > 3 and args[3] + update = True + file_type = None + lines = len(args) > 1 and args[1] if not file_type: suffix = filename.split('.')[-1].lower() if suffix in IMPORTERS.keys(): -- cgit v1.2.3