mocking sqlalchemy
This commit is contained in:
@@ -196,18 +196,23 @@ class Command(BaseCommand):
|
||||
rowers = []
|
||||
for rower in rowers:
|
||||
if extension == 'zip':
|
||||
zip_file = zipfile.ZipFile(attachment.document)
|
||||
for id,filename in enumerate(zip_file.namelist()):
|
||||
datafile = zip_file.extract(filename, path='media/')
|
||||
if id>0:
|
||||
title = name+' ('+str(id+1)+')'
|
||||
else:
|
||||
title = name
|
||||
try:
|
||||
zip_file = zipfile.ZipFile(attachment.document)
|
||||
for id,filename in enumerate(zip_file.namelist()):
|
||||
datafile = zip_file.extract(
|
||||
filename, path='media/')
|
||||
if id>0:
|
||||
title = name+' ('+str(id+1)+')'
|
||||
else:
|
||||
title = name
|
||||
|
||||
workoutid = processattachment(
|
||||
rower, datafile, title, uploadoptions,
|
||||
testing=testing
|
||||
)
|
||||
workoutid = processattachment(
|
||||
rower, datafile, title, uploadoptions,
|
||||
testing=testing
|
||||
)
|
||||
except:
|
||||
print "Bad ZIP file"
|
||||
print attachment.document.name
|
||||
else:
|
||||
# move attachment and make workout
|
||||
if testing:
|
||||
|
||||
Reference in New Issue
Block a user