Private
Public Access
1
0

Merge branch 'release/v9.85'

This commit is contained in:
Sander Roosendaal
2019-05-04 20:28:38 +02:00
10 changed files with 82 additions and 9 deletions
+1 -2
View File
@@ -1273,8 +1273,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,UnicodeDecodeError):
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."
return (0, message, f2) return (0, message, f2)
+6
View File
@@ -843,6 +843,7 @@ analysischoices = (
('histo','Histogram'), ('histo','Histogram'),
('flexall','Cumulative Flex Chart'), ('flexall','Cumulative Flex Chart'),
('stats','Statistics'), ('stats','Statistics'),
('compare','Compare'),
) )
@@ -859,6 +860,10 @@ class AnalysisChoiceForm(forms.Form):
yaxchoices = dict((x,y) for x,y in yaxchoices) yaxchoices = dict((x,y) for x,y in yaxchoices)
yaxchoices = list(sorted(yaxchoices.items(), key = lambda x:x[1])) yaxchoices = list(sorted(yaxchoices.items(), key = lambda x:x[1]))
plotchoices = (
('line','Line Plot'),
('scatter','Scatter Plot'),
)
yaxchoices2 = list( yaxchoices2 = list(
(ax[0],ax[1]) for ax in axes if ax[0] not in ['cumdist','distance','time'] (ax[0],ax[1]) for ax in axes if ax[0] not in ['cumdist','distance','time']
@@ -874,6 +879,7 @@ class AnalysisChoiceForm(forms.Form):
choices=yaxchoices,label='Left Axis',required=True,initial='power') choices=yaxchoices,label='Left Axis',required=True,initial='power')
yaxis2 = forms.ChoiceField( yaxis2 = forms.ChoiceField(
choices=yaxchoices2,label='Right Axis',required=True,initial='None') choices=yaxchoices2,label='Right Axis',required=True,initial='None')
plottype = forms.ChoiceField(choices=plotchoices,initial='scatter')
plotfield = forms.ChoiceField(choices=parchoices,initial='spm', plotfield = forms.ChoiceField(choices=parchoices,initial='spm',
label='Metric') label='Metric')
+4
View File
@@ -131,6 +131,10 @@ class RowerPlanMiddleWare(object):
messages.error(request,messg) messages.error(request,messg)
r = getrower(request.user) r = getrower(request.user)
r.rowerplan = 'basic' r.rowerplan = 'basic'
r.paymenttype = 'single'
basicplans = PaidPlan.objects.filter(shortname='basic',price=0,
paymentprocessor='braintree')
r.paidplan = basicplans[0]
r.save() r.save()
# send email # send email
job = myqueue(queue, job = myqueue(queue,
+1 -1
View File
@@ -227,7 +227,7 @@
</tr> </tr>
<tr> <tr>
<td> <td>
Available upgrades Available <a href="/rowers/upgrade/">upgrades</a>
</td> </td>
<td> <td>
&nbsp; &nbsp;
@@ -10,7 +10,7 @@
{% if recurring=='recurring' %} {% if recurring=='recurring' %}
<p> <p>
Your next charge is due on {{ end_of_billing_period }}. We will charge your {{ paymentmethod }} Your next charge is due on {{ end_of_billing_period }}. We will charge you
on that date. on that date.
</p> </p>
@@ -85,6 +85,7 @@
var xaxis = $("#id_xaxis").parent().parent(); var xaxis = $("#id_xaxis").parent().parent();
var yaxis1 = $("#id_yaxis1").parent().parent(); var yaxis1 = $("#id_yaxis1").parent().parent();
var yaxis2 = $("#id_yaxis2").parent().parent(); var yaxis2 = $("#id_yaxis2").parent().parent();
var plottype = $("#id_plottype").parent().parent();
// Hide the fields. // Hide the fields.
// Use JS to do this in case the user doesn't have JS // Use JS to do this in case the user doesn't have JS
@@ -99,6 +100,7 @@
xaxis.hide(); xaxis.hide();
yaxis1.hide(); yaxis1.hide();
yaxis2.hide(); yaxis2.hide();
plottype.hide();
if (functionfield.val() == 'boxplot') { if (functionfield.val() == 'boxplot') {
plotfield.show(); plotfield.show();
@@ -127,6 +129,12 @@
plotfield.hide(); plotfield.hide();
} }
if (functionfield.val() == 'compare') {
xaxis.show();
yaxis1.show();
plottype.show();
}
// Setup an event listener for when the state of the // Setup an event listener for when the state of the
// checkbox changes. // checkbox changes.
@@ -151,6 +159,7 @@
xaxis.hide(); xaxis.hide();
yaxis1.hide(); yaxis1.hide();
yaxis2.hide(); yaxis2.hide();
plottype.hide();
} }
else if (Value=='histo') { else if (Value=='histo') {
plotfield.show(); plotfield.show();
@@ -167,6 +176,7 @@
xaxis.hide(); xaxis.hide();
yaxis1.hide(); yaxis1.hide();
yaxis2.hide(); yaxis2.hide();
plottype.hide();
} }
else if (Value=='trendflex') { else if (Value=='trendflex') {
@@ -184,6 +194,7 @@
xaxis.hide(); xaxis.hide();
yaxis1.hide(); yaxis1.hide();
yaxis2.hide(); yaxis2.hide();
plottype.hide();
} }
else if (Value=='flexall') { else if (Value=='flexall') {
@@ -200,6 +211,7 @@
plotfield.hide(); plotfield.hide();
palette.hide(); palette.hide();
binsize.hide(); binsize.hide();
plottype.hide();
errorbars.hide(); errorbars.hide();
} }
else if (Value=='stats') { else if (Value=='stats') {
@@ -213,6 +225,24 @@
palette.hide(); palette.hide();
binsize.hide(); binsize.hide();
errorbars.hide(); errorbars.hide();
plottype.hide();
}
else if (Value=='compare') {
xaxis.show();
yaxis1.show();
yaxis2.hide();
x_param.hide();
y_param.hide();
groupby.hide();
spmmin.hide();
spmmax.hide();
workmin.hide();
workmax.hide();
plotfield.hide();
palette.hide();
binsize.hide();
plottype.show();
errorbars.hide();
} }
}); });
}); });
Binary file not shown.
+5 -2
View File
@@ -493,8 +493,11 @@ def get_strava_stream(r,metric,stravaid,series_type='time',fetchresolution='high
for data in s.json(): for data in s.json():
y = None y = None
if data['type'] == metric: try:
return np.array(data['data']) if data['type'] == metric:
return np.array(data['data'])
except TypeError:
return None
return None return None
+31
View File
@@ -545,6 +545,35 @@ def statsdata(workouts, options):
return('',html_content) return('',html_content)
def comparisondata(workouts,options):
includereststrokes = options['includereststrokes']
xparam = options['xaxis']
yparam1 = options['yaxis1']
plottype = options['plottype']
promember=True
workstrokesonly = not includereststrokes
ids = [w.id for w in workouts]
labeldict = {
int(w.id): w.__str__() for w in workouts
}
res = interactive_multiple_compare_chart(ids,xparam,yparam1,
promember=promember,
plottype=plottype,
labeldict=labeldict)
script = res[0]
div = res[1]
scripta = script.split('\n')[2:-1]
script = ''.join(scripta)
return(script,div)
def boxplotdata(workouts,options): def boxplotdata(workouts,options):
includereststrokes = options['includereststrokes'] includereststrokes = options['includereststrokes']
@@ -656,6 +685,8 @@ def analysis_view_data(request,userid=0):
script,div = flexalldata(workouts,options) script,div = flexalldata(workouts,options)
elif function == 'stats': elif function == 'stats':
script,div = statsdata(workouts,options) script,div = statsdata(workouts,options)
elif function == 'compare':
script,div = comparisondata(workouts,options)
else: else:
script = '' script = ''
div = 'Unknown analysis functions' div = 'Unknown analysis functions'
+1 -1
View File
@@ -1874,7 +1874,7 @@ def workout_downloadmetar_view(request,id=0,
try: try:
row.notes += "\n"+message row.notes += "\n"+message
except TypeError: except TypeError:
if message: if message is not None:
row.notes += message row.notes += message
row.save() row.save()