Private
Public Access
1
0

email zip processing improved

This commit is contained in:
Sander Roosendaal
2017-04-14 15:12:35 +02:00
parent 5bc69b3a49
commit ef398dcaee
5 changed files with 18 additions and 22 deletions

View File

@@ -573,26 +573,20 @@ def new_workout_from_file(r,f2,
inboard = 0.88
if len(fileformat)==3 and fileformat[0]=='zip':
f_to_be_deleted = f2
with zipfile.ZipFile(f2) as z:
for fname in z.namelist():
f3 = z.extract(fname,path='media/')
print f3,r.user.email,title
if settings.DEBUG:
res = handle_zip_file.delay(
r.user.email,title,f3
)
title = os.path.basename(f2)
if settings.DEBUG:
res = handle_zip_file.delay(
r.user.email,title,f2
)
else:
res = queuelow.enqueue(
handle_zip_file,
r.user.email,
title,
f3
)
else:
res = queuelow.enqueue(
handle_zip_file,
r.user.email,
title,
f2
)
os.remove(f_to_be_deleted)
return -1,message,f2
# Some people try to upload Concept2 logbook summaries