improved zip processing
This commit is contained in:
@@ -572,9 +572,15 @@ def new_workout_from_file(r,f2,
|
|||||||
with zipfile.ZipFile(f2) as z:
|
with zipfile.ZipFile(f2) as z:
|
||||||
# for now, we're getting only the first file
|
# for now, we're getting only the first file
|
||||||
# from the NK zip file (issue #69 on bitbucket)
|
# from the NK zip file (issue #69 on bitbucket)
|
||||||
f2 = z.extract(z.namelist()[0],path='media/')
|
for fname in z.namelist():
|
||||||
fileformat = fileformat[2]
|
f3 = z.extract(fname,path='media/')
|
||||||
|
id,message,f2 = new_workout_from_file(r,f3,
|
||||||
|
workouttype=workouttype,
|
||||||
|
makeprivate=makeprivate,
|
||||||
|
title = title,
|
||||||
|
notes='')
|
||||||
os.remove(f_to_be_deleted)
|
os.remove(f_to_be_deleted)
|
||||||
|
return id,message,f2
|
||||||
|
|
||||||
# Some people try to upload Concept2 logbook summaries
|
# Some people try to upload Concept2 logbook summaries
|
||||||
if fileformat == 'c2log':
|
if fileformat == 'c2log':
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{% extends "bases.html" %}
|
{% extends "base.html" %}
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
{% load rowerfilters %}
|
{% load rowerfilters %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{% extends "bases.html" %}
|
{% extends "base.html" %}
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
{% load rowerfilters %}
|
{% load rowerfilters %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{% extends "bases.html" %}
|
{% extends "base.html" %}
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
{% load rowerfilters %}
|
{% load rowerfilters %}
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{% extends "bases.html" %}
|
{% extends "base.html" %}
|
||||||
{% load staticfiles %}
|
{% load staticfiles %}
|
||||||
{% load rowerfilters %}
|
{% load rowerfilters %}
|
||||||
|
|
||||||
|
|||||||
@@ -5169,11 +5169,24 @@ def workout_upload_view(request,message="",
|
|||||||
request.session['uploadoptions'] = uploadoptions
|
request.session['uploadoptions'] = uploadoptions
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
makeprivate = uploadoptions['makeprivate']
|
makeprivate = uploadoptions['makeprivate']
|
||||||
|
except KeyError:
|
||||||
|
makeprivate = False
|
||||||
|
try:
|
||||||
make_plot = uploadoptions['make_plot']
|
make_plot = uploadoptions['make_plot']
|
||||||
|
except KeyError:
|
||||||
|
make_plot = False
|
||||||
|
|
||||||
|
try:
|
||||||
plottype = uploadoptions['plottype']
|
plottype = uploadoptions['plottype']
|
||||||
|
except KeyError:
|
||||||
|
plottype = 'timeplot'
|
||||||
|
|
||||||
|
try:
|
||||||
upload_toc2 = uploadoptions['upload_to_C2']
|
upload_toc2 = uploadoptions['upload_to_C2']
|
||||||
|
except KeyError:
|
||||||
|
upload_toc2 = False
|
||||||
|
|
||||||
r = Rower.objects.get(user=request.user)
|
r = Rower.objects.get(user=request.user)
|
||||||
if request.method == 'POST':
|
if request.method == 'POST':
|
||||||
|
|||||||
Reference in New Issue
Block a user