email zip processing improved
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user