diff --git a/rowers/braintreestuff.py b/rowers/braintreestuff.py index ad529751..f67cc135 100644 --- a/rowers/braintreestuff.py +++ b/rowers/braintreestuff.py @@ -20,7 +20,7 @@ from rowers.tasks import ( handle_send_email_subscription_create, handle_send_email_failed_cancel, ) - + import pandas as pd from rowsandall_app.settings import ( @@ -70,7 +70,7 @@ def create_customer(rower,force=False): else: return rower.customer_id - + def get_client_token(rower): try: @@ -79,10 +79,10 @@ def get_client_token(rower): }) except ValueError: customer_id = create_customer(rower,force=True) - + client_token = gateway.client_token.generate({ "customer_id": customer_id, - }) + }) return client_token @@ -90,7 +90,7 @@ def get_plans_costs(): plans = gateway.plan.all() localplans = PaidPlan.object.filter(paymentprocessor='braintree') - + for plan in localplans: for btplan in btplans: if int(btplan.id) == plan.external_id: @@ -108,7 +108,7 @@ def make_payment(rower,data): amount = data['amount'] amount = '{amount:.f2}'.format(amount=amount) - + result = gateway.transaction.sale({ "amount": amount, "payment_method_nonce": nonce_from_the_client, @@ -123,7 +123,7 @@ def make_payment(rower,data): f = rower.user.first_name, l = rower.user.last_name, ) - + job = myqueue(queuehigh,handle_send_email_transaction, name, rower.user.email, amount) @@ -143,7 +143,7 @@ def update_subscription(rower,data,method='up'): amount = data['amount'] amount = '{amount:.2f}'.format(amount=amount) - + gatewaydata = { "price": amount, "plan_id": plan.external_id, @@ -192,7 +192,7 @@ def update_subscription(rower,data,method='up'): coachgroup.save() rower.mycoachgroup = coachgroup rower.save() - + athletes = Rower.objects.filter(coachinggroups__in=[rower.mycoachgroup]).distinct() for athlete in athletes: athlete.coachinggroups.remove(rower.mycoachgroup) @@ -217,7 +217,7 @@ def update_subscription(rower,data,method='up'): amount, result.subscription.billing_period_end_date.strftime('%Y-%m-%d'), method) - + return True,amount else: errors = result.errors.for_object("subscription") @@ -230,12 +230,12 @@ def update_subscription(rower,data,method='up'): if create_new: return create_subscription(rower,data) - + return False,0 return False,0 - - + + def create_subscription(rower,data): nonce_from_the_client = data['payment_method_nonce'] nonce = gateway.payment_method_nonce.find(nonce_from_the_client) @@ -249,8 +249,8 @@ def create_subscription(rower,data): planid = data['plan'] plan = PaidPlan.objects.get(id=planid) - - + + # create or find payment method result = gateway.payment_method.create({ "customer_id": rower.customer_id, @@ -270,6 +270,7 @@ def create_subscription(rower,data): if result.is_success: + yesterday = (timezone.now()-datetime.timedelta(days=1)).date() rower.paidplan = plan rower.planexpires = result.subscription.billing_period_end_date rower.teamplanexpires = result.subscription.billing_period_end_date @@ -277,6 +278,8 @@ def create_subscription(rower,data): rower.paymenttype = plan.paymenttype rower.rowerplan = plan.shortname rower.subscription_id = result.subscription.id + rower.protrialexpires = yesterday + rower.plantrialexpires = yesterday rower.save() name = '{f} {l}'.format( @@ -286,7 +289,7 @@ def create_subscription(rower,data): recurring = plan.paymenttype - + job = myqueue( queuehigh, handle_send_email_subscription_create, @@ -312,15 +315,15 @@ def cancel_subscription(rower,id): themessages.append("Subscription canceled") except: errormessages.append("We could not find the subscription record in our customer database. We have notified the site owner, who will contact you.") - + name = '{f} {l}'.format(f = rower.user.first_name, l = rower.user.last_name) - - + + job = myqueue(queuehigh, handle_send_email_failed_cancel, name, rower.user.email,rower.user.username,id) - + return False, themessages, errormessages basicplans = PaidPlan.objects.filter(price=0,paymentprocessor='braintree') @@ -343,7 +346,7 @@ def find_subscriptions(rower): raise ProcessorCustomerError("We could not find the customer in the database") active_subscriptions = [] - + cards = result.credit_cards for card in cards: for subscription in card.subscriptions: @@ -360,12 +363,12 @@ def find_subscriptions(rower): pass result = [] - + for subscription in active_subscriptions: plan = PaidPlan.objects.filter(paymentprocessor="braintree", external_id=subscription.plan_id)[0] - + thedict = { 'end_date': subscription.billing_period_end_date, 'plan_id': subscription.plan_id, @@ -444,7 +447,7 @@ def get_transactions(start_date,end_date): transaction.credit_card_details.country_of_issuance) statuses.append(transaction.status) - + df = pd.DataFrame({ 'name':names, 'email':emails, diff --git a/rowers/dataprep.py b/rowers/dataprep.py index c9a8fd80..d585765f 100644 --- a/rowers/dataprep.py +++ b/rowers/dataprep.py @@ -153,7 +153,15 @@ def get_video_data(w,groups=['basic']): boatspeed = (100*df2['velo']).astype(int)/100. - coordinates = get_latlon_time(w.id) + try: + coordinates = get_latlon_time(w.id) + except KeyError: + nulseries = df['time']*0 + coordinates = pd.DataFrame({ + 'time': df['time'], + 'latitude': nulseries, + 'longitude': nulseries, + }) coordinates.set_index(pd.to_timedelta(coordinates['time'],unit='s'),inplace=True) coordinates = coordinates.resample('1s').mean().interpolate() @@ -1816,6 +1824,7 @@ def getrowdata_db(id=0, doclean=False, convertnewtons=True, def getsmallrowdata_db(columns, ids=[], doclean=True,workstrokesonly=True,compute=True): # prepmultipledata(ids) + if ids: csvfilenames = ['media/strokedata_{id}.parquet.gz'.format(id=id) for id in ids] else: @@ -1825,6 +1834,7 @@ def getsmallrowdata_db(columns, ids=[], doclean=True,workstrokesonly=True,comput columns = [c for c in columns if c != 'None'] columns = list(set(columns)) + if len(ids)>1: for id,f in zip(ids,csvfilenames): try: diff --git a/rowers/dataprepnodjango.py b/rowers/dataprepnodjango.py index bdd1f162..ab1f8506 100644 --- a/rowers/dataprepnodjango.py +++ b/rowers/dataprepnodjango.py @@ -726,7 +726,10 @@ def getsmallrowdata_db(columns,ids=[],debug=False): except ValueError: df = pd.DataFrame() else: - df = pd.read_parquet(csvfilenames[0],columns=columns,engine='pyarrow') + try: + df = pd.read_parquet(csvfilenames[0],columns=columns,engine='pyarrow') + except (OSError,IndexError): + pass return df @@ -1257,7 +1260,7 @@ def dataprep(rowdatadf,id=0,bands=True,barchart=True,otwpower=True, data.fillna(0,inplace=True) for k, v in dtypes.items(): try: - data[k] = data[k].astype(v) + data[k] = data[k].astype(v) except KeyError: pass diff --git a/rowers/interactiveplots.py b/rowers/interactiveplots.py index 8f92c862..5224ea7a 100644 --- a/rowers/interactiveplots.py +++ b/rowers/interactiveplots.py @@ -2814,7 +2814,7 @@ def interactive_chart(id=0,promember=0,intervaldata = {}): TOOLS = 'pan,box_zoom,wheel_zoom,reset,tap,hover,crosshair' - columns = ['time','pace','hr','fpace','ftime'] + columns = ['time','pace','hr','fpace','ftime','spm'] datadf = dataprep.getsmallrowdata_db(columns,ids=[id]) datadf.dropna(axis=0,how='any',inplace=True) @@ -2945,10 +2945,90 @@ def interactive_chart(id=0,promember=0,intervaldata = {}): hover.mode = 'mouse' hover.names = ["spm","pace"] - script, div = components(plot) + script, div = components(layout) return [script,div] +def interactive_chart_video(videodata): + + spm = videodata['spm'] + time = range(len(spm)) + + + + data = zip(time,spm) + + data2 = [] + + for t,s in data: + data2.append( + { + 'x':t, + 'y':s, + } + ) + + markerpoint = { + 'x': time[0], + 'y': spm[0], + 'r': 10, + } + + div = """ + + + """ + + script = """ + var ctx = document.getElementById("myChart").getContext('2d'); + var data = %s + + var myChart = new Chart(ctx, { + type: 'scatter', + label: 'pace', + data: + { + datasets: [ + { + type: 'bubble', + label: 'now', + data: [ %s ], + backgroundColor: '#36a2eb', + }, + { + label: 'spm', + data: data, + }, + + ] + }, + + }); + var marker = { + datapoint: %s , + setLatLng: function (LatLng) { + var lat = LatLng.lat; + var lng = LatLng.lng; + this.datapoint = { + 'x': lat, + 'y': lng, + 'r': 10, + } + myChart.data.datasets[0].data[0] = this.datapoint; + myChart.update(); + } + } + marker.setLatLng({ + 'lat': data[0]['x'], + 'lng': data[0]['y'] + }) + + """ % (data2, markerpoint, markerpoint) + + return [script,div] + + + def interactive_multiflex(datadf,xparam,yparam,groupby,extratitle='', ploterrorbars=False, title=None,binsize=1,colorlegend=[], @@ -3435,10 +3515,10 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, var distance1 = data['distance'] var power1 = data['power'] var driveenergy1 = data['driveenergy'] - var xname = data['xname'][0] - var yname1 = data['yname1'][0] - var yname2 = data['yname2'][0] - var workoutid1 = data['workoutid'][0] + var xname = data['xname'] + var yname1 = data['yname1'] + var yname2 = data['yname2'] + var workoutid1 = data['workoutid'] var minspm = minspm.value var maxspm = maxspm.value @@ -3483,10 +3563,10 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, data2['driveenergy'].push(driveenergy1[i]) data2['distance'].push(distance1[i]) data2['power'].push(power1[i]) - data2['workoutid'].push(workoutid1) - data2['xname'].push(xname) - data2['yname1'].push(yname1) - data2['yname2'].push(yname2) + data2['workoutid'].push(0) + data2['xname'].push(0) + data2['yname1'].push(0) + data2['yname2'].push(0) xm += x1[i] ym1 += y1[i] @@ -3510,9 +3590,9 @@ def interactive_cum_flex_chart2(theworkouts,promember=0, x1means.location = xm y1means.location = ym1 y2means.location = ym2 - y1label.text = yname1+': '+(ym1).toFixed(2) - y2label.text = yname2+': '+(ym2).toFixed(2) - xlabel.text = xname+': '+(xm).toFixed(2) + y1label.text = yname1[0]+': '+(ym1).toFixed(2) + y2label.text = yname2[0]+': '+(ym2).toFixed(2) + xlabel.text = xname[0]+': '+(xm).toFixed(2) source2.change.emit(); """) @@ -3596,16 +3676,16 @@ def interactive_flex_chart2(id=0,promember=0, columns = [xparam,yparam1,yparam2, 'ftime','distance','fpace', 'power','hr','spm','driveenergy', - 'time','pace','workoutstate','time'] + 'time','pace','workoutstate'] rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True, workstrokesonly=workstrokesonly) - if rowdata.empty: + if len(rowdata)<2: rowdata = dataprep.getsmallrowdata_db(columns,ids=[id],doclean=True, workstrokesonly=False) workstrokesonly=False - if rowdata.empty: + if len(rowdata)<2: rowdata = dataprep.getsmallrowdata_db(columns,ids=[id], doclean=False, workstrokesonly=False) @@ -3760,6 +3840,8 @@ def interactive_flex_chart2(id=0,promember=0, rowdata ) + + # second source for filtering source2 = ColumnDataSource( rowdata.copy() @@ -4014,12 +4096,11 @@ def interactive_flex_chart2(id=0,promember=0, var distance1 = data['distance'] var power1 = data['power'] var driveenergy1 = data['driveenergy'] - var xname = data['xname'][0] - var yname1 = data['yname1'][0] - var yname2 = data['yname2'][0] - var workoutid1 = data['workoutid'][0] - var workoutstate1 = data['workoutstate'][0] - + var xname = data['xname'] + var yname1 = data['yname1'] + var yname2 = data['yname2'] + var workoutid1 = data['workoutid'] + var workoutstate1 = data['workoutstate'] var annotation = annotation.value var minspm = minspm.value @@ -4077,11 +4158,11 @@ def interactive_flex_chart2(id=0,promember=0, data2['hr'].push(hr1[i]) data2['distance'].push(distance1[i]) data2['power'].push(power1[i]) - data2['workoutid'].push(workoutid1) - data2['workoutstate'].push(workoutstate1) - data2['xname'].push(xname) - data2['yname1'].push(yname1) - data2['yname2'].push(yname2) + data2['workoutid'].push(0) + data2['workoutstate'].push(0) + data2['xname'].push(0) + data2['yname1'].push(0) + data2['yname2'].push(0) xm += x1[i] @@ -4107,9 +4188,9 @@ def interactive_flex_chart2(id=0,promember=0, x1means.location = xm y1means.location = ym1 y2means.location = ym2 - y1label.text = yname1+': '+ym1.toFixed(2) - y2label.text = yname2+': '+ym2.toFixed(2) - xlabel.text = xname+': '+xm.toFixed(2) + y1label.text = yname1[0]+': '+ym1.toFixed(2) + y2label.text = yname2[0]+': '+ym2.toFixed(2) + xlabel.text = xname[0]+': '+xm.toFixed(2) annolabel.text = annotation source2.change.emit(); diff --git a/rowers/templates/embedded_video.html b/rowers/templates/embedded_video.html index 19164b1b..4a28416d 100644 --- a/rowers/templates/embedded_video.html +++ b/rowers/templates/embedded_video.html @@ -11,6 +11,8 @@ {% block meta %} {% leaflet_js %} {% leaflet_css %} + + {% endblock %} {% block main %} @@ -71,12 +73,13 @@ {% endif %}
  • -
    +
    {{ mapdiv | safe}}
    - +
  • @@ -85,6 +88,7 @@ // 1. Code for the map {{ mapscript | safe }} + // 2. This code loads the IFrame Player API code asynchronously. var tag = document.createElement('script'); @@ -154,6 +158,7 @@ {% endfor %} // gauge.set(catch_now); var newLatLng = new L.LatLng(lat, lon); + console.log(newLatLng); marker.setLatLng(newLatLng); } if(videotime !== oldTime) { diff --git a/rowers/templates/flexchart3otw.html b/rowers/templates/flexchart3otw.html index 0355b053..e89e394b 100644 --- a/rowers/templates/flexchart3otw.html +++ b/rowers/templates/flexchart3otw.html @@ -32,7 +32,7 @@

    Flexible Chart

    - +
    • @@ -56,7 +56,7 @@

    • - +
    • {% if favoritenr > 0 %} diff --git a/rowers/views/analysisviews.py b/rowers/views/analysisviews.py index d76f3a57..a7ea6a70 100644 --- a/rowers/views/analysisviews.py +++ b/rowers/views/analysisviews.py @@ -31,7 +31,7 @@ defaultoptions = { @user_passes_test(ispromember, login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def analysis_new(request,userid=0,function='boxplot',teamid=0): r = getrequestrower(request, userid=userid) @@ -667,7 +667,7 @@ def boxplotdata(workouts,options): return(script,div) @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def analysis_view_data(request,userid=0): if not request.is_ajax(): @@ -725,7 +725,7 @@ def analysis_view_data(request,userid=0): # Histogram for a date/time range @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def histo(request,theuser=0, startdate=timezone.now()-datetime.timedelta(days=365), @@ -2148,7 +2148,7 @@ def rankings_view2(request,theuser=0, # Show ranking distances including predicted paces @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def otwrankings_view(request,theuser=0, startdate=timezone.now()-datetime.timedelta(days=365), @@ -2553,7 +2553,7 @@ def otwcp_toadmin_view(request,theuser=0, # Show ranking distances including predicted paces @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def oterankings_view(request,theuser=0, startdate=timezone.now()-datetime.timedelta(days=365), @@ -2904,7 +2904,7 @@ def oterankings_view(request,theuser=0, # Multi Flex Chart with Grouping @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def user_multiflex_select(request, startdatestring="", @@ -3110,7 +3110,7 @@ def user_multiflex_select(request, }) @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def multiflex_data(request,userid=0, options={ @@ -3363,7 +3363,7 @@ def multiflex_data(request,userid=0, @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def multiflex_view(request,userid=0, options={ @@ -3530,7 +3530,7 @@ def multiflex_view(request,userid=0, # Box plots @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def user_boxplot_select(request, startdatestring="", @@ -3738,7 +3738,7 @@ def user_boxplot_select(request, }) @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def boxplot_view_data(request,userid=0, options={ @@ -3855,7 +3855,7 @@ def boxplot_view_data(request,userid=0, }) @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def boxplot_view(request,userid=0, options={ @@ -3974,7 +3974,7 @@ def boxplot_view(request,userid=0, # Cumulative stats page -@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher",redirect_field_name=None) +@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",redirect_field_name=None) def cumstats(request,theuser=0, startdate=timezone.now()-datetime.timedelta(days=30), enddate=timezone.now(), @@ -4323,7 +4323,7 @@ def agegrouprecordview(request,sex='male',weightcategory='hwt', # alert overview view @user_passes_test(ispromember, login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def alerts_view(request,userid=0): r = getrequestrower(request,userid=userid) @@ -4357,7 +4357,7 @@ def alerts_view(request,userid=0): # alert create view @user_passes_test(ispromember, login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def alert_create_view(request,userid=0): r = getrequestrower(request,userid=userid) @@ -4437,7 +4437,7 @@ def alert_create_view(request,userid=0): # alert report view @user_passes_test(ispromember, login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def alert_report_view(request,id=0,userid=0,nperiod=0): r = getrequestrower(request,userid=userid) @@ -4494,7 +4494,7 @@ def alert_report_view(request,id=0,userid=0,nperiod=0): # alert edit view @user_passes_test(ispromember, login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def alert_edit_view(request,id=0,userid=0): r = getrequestrower(request,userid=userid) diff --git a/rowers/views/workoutviews.py b/rowers/views/workoutviews.py index 032f4564..efee957e 100644 --- a/rowers/views/workoutviews.py +++ b/rowers/views/workoutviews.py @@ -196,9 +196,16 @@ def workout_video_create_view(request,id=0): # get data data, metrics, maxtime = dataprep.get_video_data(w,groups=metricsgroups) + hascoordinates = pd.Series(data['latitude']).std() > 0 + # create map - mapscript, mapdiv = leaflet_chart_video(data['latitude'],data['longitude'], + if hascoordinates: + mapscript, mapdiv = leaflet_chart_video(data['latitude'],data['longitude'], w.name) + else: + mapscript, mapdiv = interactive_chart_video(data) + data['longitude'] = data['spm'] + data['latitude'] = list(range(len(data['spm']))) breadcrumbs = [ { @@ -218,8 +225,12 @@ def workout_video_create_view(request,id=0): analysis = {'delay':delay} + template = 'embedded_video.html' + + print(data['latitude'],'aap') + return render(request, - 'embedded_video.html', + template, { 'workout':w, 'rower':request.user.rower, @@ -238,7 +249,7 @@ def workout_video_create_view(request,id=0): # Show the EMpower Oarlock generated Stroke Profile @user_passes_test(ispromember,login_url="/rowers/paidplans/", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def workout_forcecurve_view(request,id=0,workstrokesonly=False): row = get_workout(id) @@ -566,8 +577,9 @@ def fitness_metric_view(request,mode='rower',days=42): return HttpResponse("job queued") +@login_required() @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def workout_update_cp_view(request,id=0): row = get_workout(id) @@ -630,7 +642,7 @@ def workout_recalcsummary_view(request,id=0): # Joining workout @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def workouts_join_view(request): promember=0 @@ -875,7 +887,7 @@ def video_selectworkout(request,userid=0,teamid=0): @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def workouts_join_select(request, startdatestring="", @@ -1033,7 +1045,7 @@ def workouts_join_select(request, # Team comparison @user_passes_test(ispromember,login_url='/rowers/paidplans/', - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def team_comparison_select(request, startdatestring="", @@ -1816,7 +1828,7 @@ def workouts_view(request,message='',successmessage='', # List of workouts to compare a selected workout to @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def workout_fusion_list(request,id=0,message='',successmessage='', startdatestring="",enddatestring="", @@ -2022,7 +2034,7 @@ def workout_view(request,id=0): # Resets stroke data to raw data (pace) @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def workout_undo_smoothenpace_view( request,id=0,message="",successmessage="" @@ -2061,7 +2073,7 @@ def workout_undo_smoothenpace_view( # Data smoothing of pace data @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def workout_smoothenpace_view(request,id=0,message="",successmessage=""): row = get_workout(id) @@ -2114,7 +2126,7 @@ def workout_smoothenpace_view(request,id=0,message="",successmessage=""): # Process CrewNerd Summary CSV and update summary @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def workout_crewnerd_summary_view(request,id=0,message="",successmessage=""): row = get_workout(id) @@ -2191,7 +2203,7 @@ def workout_crewnerd_summary_view(request,id=0,message="",successmessage=""): # Get weather for given location and date/time @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def workout_downloadwind_view(request,id=0, airportcode=None, @@ -2265,7 +2277,7 @@ def workout_downloadwind_view(request,id=0, return response # Get weather for given location and date/time -@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher",redirect_field_name=None) +@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",redirect_field_name=None) def workout_downloadmetar_view(request,id=0, airportcode=None, message="",successmessage=""): @@ -2340,7 +2352,7 @@ def workout_downloadmetar_view(request,id=0, # Show form to update wind data -@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher",redirect_field_name=None) +@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",redirect_field_name=None) def workout_wind_view(request,id=0,message="",successmessage=""): row = get_workout(id) r = getrower(request.user) @@ -2476,7 +2488,7 @@ def workout_wind_view(request,id=0,message="",successmessage=""): # Show form to update River stream data (for river dwellers) -@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher",redirect_field_name=None) +@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",redirect_field_name=None) def workout_stream_view(request,id=0,message="",successmessage=""): row = get_workout(id) r = getrower(request.user) @@ -5098,7 +5110,7 @@ def workout_summary_restore_view(request,id,message="",successmessage=""): # Split a workout @user_passes_test(ispromember,login_url="/rowers/paidplans", - message="This functionality requires a Pro plan or higher", + message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality", redirect_field_name=None) def workout_split_view(request,id=0): row = get_workout_permitted(request.user,id) @@ -5194,7 +5206,7 @@ def workout_split_view(request,id=0): # Fuse two workouts -@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher",redirect_field_name=None) +@user_passes_test(ispromember,login_url="/rowers/paidplans",message="This functionality requires a Pro plan or higher. If you are already a Pro user, please log in to access this functionality",redirect_field_name=None) def workout_fusion_view(request,id1=0,id2=1): try: