Private
Public Access
1
0

mocking sqlalchemy

This commit is contained in:
Sander Roosendaal
2019-01-03 12:32:24 +01:00
parent c006c0599a
commit 331b6c0049
4 changed files with 61 additions and 33 deletions

View File

@@ -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: