From 9f96a875d27893472633509663f433a517a73deb Mon Sep 17 00:00:00 2001 From: Sander Roosendaal Date: Wed, 8 Nov 2017 13:33:25 +0100 Subject: [PATCH] better numbering for zip file content --- rowers/management/commands/processemail.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rowers/management/commands/processemail.py b/rowers/management/commands/processemail.py index 5adffab1..d35156fe 100644 --- a/rowers/management/commands/processemail.py +++ b/rowers/management/commands/processemail.py @@ -134,7 +134,11 @@ class Command(BaseCommand): zip_file = zipfile.ZipFile(attachment.document) for id,filename in enumerate(zip_file.namelist()): datafile = zip_file.extract(filename, path='media/') - title = name+' ('+str(id)+')' + if id>0: + title = name+' ('+str(id+1)+')' + else: + title = name + workoutid = processattachment( rower, datafile, title, uploadoptions, testing=testing