fxix #464
This commit is contained in:
@@ -1280,6 +1280,7 @@ def new_workout_from_file(r, f2,
|
|||||||
message = None
|
message = None
|
||||||
try:
|
try:
|
||||||
fileformat = get_file_type(f2)
|
fileformat = get_file_type(f2)
|
||||||
|
print(fileformat,'aa')
|
||||||
except IOError:
|
except IOError:
|
||||||
os.remove(f2)
|
os.remove(f2)
|
||||||
message = "Rowsandall could not process this file. The extension is supported but the file seems corrupt. Contact info@rowsandall.com if you think this is incorrect."
|
message = "Rowsandall could not process this file. The extension is supported but the file seems corrupt. Contact info@rowsandall.com if you think this is incorrect."
|
||||||
@@ -1337,7 +1338,13 @@ def new_workout_from_file(r, f2,
|
|||||||
# worth supporting
|
# worth supporting
|
||||||
if fileformat == 'unknown':
|
if fileformat == 'unknown':
|
||||||
message = "We couldn't recognize the file type"
|
message = "We couldn't recognize the file type"
|
||||||
f4 = f2[:-5]+'a'+f2[-5:]
|
extension = os.path.splitext(f2)[1]
|
||||||
|
filename = os.path.splitext(f2)[0]
|
||||||
|
if extension == '.gz':
|
||||||
|
filename = os.path.splitext(filename)[0]
|
||||||
|
extension2 = os.path.splitext(filename)[1]+extension
|
||||||
|
extension = extension2
|
||||||
|
f4 = filename+'a'+extension
|
||||||
copyfile(f2,f4)
|
copyfile(f2,f4)
|
||||||
job = myqueue(queuehigh,
|
job = myqueue(queuehigh,
|
||||||
handle_sendemail_unrecognized,
|
handle_sendemail_unrecognized,
|
||||||
|
|||||||
@@ -1661,6 +1661,8 @@ def handle_makeplot(f1, f2, t, hrdata, plotnr, imagename,
|
|||||||
haspower = row.df[' Power (watts)'].mean() > 50
|
haspower = row.df[' Power (watts)'].mean() > 50
|
||||||
except TypeError:
|
except TypeError:
|
||||||
haspower = True
|
haspower = True
|
||||||
|
except KeyError:
|
||||||
|
haspower = False
|
||||||
|
|
||||||
nr_rows = len(row.df)
|
nr_rows = len(row.df)
|
||||||
if (plotnr in [1, 2, 4, 5, 8, 11, 9, 12]) and (nr_rows > 1200):
|
if (plotnr in [1, 2, 4, 5, 8, 11, 9, 12]) and (nr_rows > 1200):
|
||||||
|
|||||||
@@ -72,16 +72,13 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
{% if rower.user %}
|
{% if rower.user %}
|
||||||
<h1>{{ rower.user.first_name }} Power Estimates</h1>
|
<h1>Power Progress for {{ rower.user.first_name }} </h1>
|
||||||
{% else %}
|
{% else %}
|
||||||
<h1>{{ user.first_name }} Power Estimates</h1>
|
<h1>Power Progress for {{ user.first_name }} </h1>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|
||||||
<ul class="main-content">
|
<ul class="main-content">
|
||||||
<li class="grid_4">
|
|
||||||
{{ the_div|safe }}
|
|
||||||
</li>
|
|
||||||
<li class="grid_2">
|
<li class="grid_2">
|
||||||
<form enctype="multipart/form-data" action="/rowers/fitness-progress/user/{{ rower.user.id }}/" method="post">
|
<form enctype="multipart/form-data" action="/rowers/fitness-progress/user/{{ rower.user.id }}/" method="post">
|
||||||
<table>
|
<table>
|
||||||
@@ -92,6 +89,9 @@
|
|||||||
</form>
|
</form>
|
||||||
|
|
||||||
</li>
|
</li>
|
||||||
|
<li class="grid_4">
|
||||||
|
{{ the_div|safe }}
|
||||||
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
Binary file not shown.
@@ -611,11 +611,24 @@ def fitnessmetric_view(request,id=0,mode='rower',
|
|||||||
enddate=enddate,
|
enddate=enddate,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
breadcrumbs = [
|
||||||
|
{
|
||||||
|
'url':'/rowers/analysis',
|
||||||
|
'name':'Analysis'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
'url':reverse('fitness_metric_view'),
|
||||||
|
'name': 'Power Progress'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
return render(request,'fitnessmetric.html',
|
return render(request,'fitnessmetric.html',
|
||||||
{
|
{
|
||||||
'rower':therower,
|
'rower':therower,
|
||||||
'active':'nav-analysis',
|
'active':'nav-analysis',
|
||||||
'chartscript':script,
|
'chartscript':script,
|
||||||
|
'breadcrumbs':breadcrumbs,
|
||||||
'the_div':thediv,
|
'the_div':thediv,
|
||||||
'mode':mode,
|
'mode':mode,
|
||||||
'form':form,
|
'form':form,
|
||||||
|
|||||||
Reference in New Issue
Block a user