Merge branch 'release/v16.7.4'
This commit is contained in:
@@ -24,7 +24,7 @@ from rowers.tasks import (
|
|||||||
handle_send_email_subscription_update,
|
handle_send_email_subscription_update,
|
||||||
handle_send_email_subscription_create,
|
handle_send_email_subscription_create,
|
||||||
handle_send_email_failed_cancel,
|
handle_send_email_failed_cancel,
|
||||||
handle_send_email_transaction_notification,
|
#handle_send_email_transaction_notification,
|
||||||
)
|
)
|
||||||
|
|
||||||
import pandas as pd
|
import pandas as pd
|
||||||
|
|||||||
@@ -1343,15 +1343,15 @@ def handle_send_email_transaction(
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
@app.task
|
@app.task
|
||||||
def handle_send_email_transaction_notification(
|
def handle_send_email_instantplan_notification(
|
||||||
username, useremail, amount, additional_text, **kwargs):
|
username, useremail, amount, planname,startdate, enddate, **kwargs):
|
||||||
|
|
||||||
if 'debug' in kwargs: # pragma: no cover
|
if 'debug' in kwargs: # pragma: no cover
|
||||||
debug = kwargs['debug']
|
debug = kwargs['debug']
|
||||||
else:
|
else:
|
||||||
debug = True
|
debug = True
|
||||||
|
|
||||||
subject = "Rowsandall Payment Confirmation"
|
subject = "Rowsandall Instant Plan Notification"
|
||||||
|
|
||||||
from_email = 'Rowsandall <admin@rowsandall.com>'
|
from_email = 'Rowsandall <admin@rowsandall.com>'
|
||||||
|
|
||||||
@@ -1359,10 +1359,12 @@ def handle_send_email_transaction_notification(
|
|||||||
'name': username,
|
'name': username,
|
||||||
'siteurl': siteurl,
|
'siteurl': siteurl,
|
||||||
'amount': amount,
|
'amount': amount,
|
||||||
'reason':additional_text,
|
'planname': planname,
|
||||||
|
'startdate':startdate,
|
||||||
|
'enddate':enddate,
|
||||||
}
|
}
|
||||||
|
|
||||||
res = send_template_email(from_email,['support@rowsandall.com'],
|
res = send_template_email(from_email,['roosendaalsander@gmail.com'],
|
||||||
subject,
|
subject,
|
||||||
'instantplansold.html',
|
'instantplansold.html',
|
||||||
d, **kwargs)
|
d, **kwargs)
|
||||||
|
|||||||
@@ -4,11 +4,11 @@
|
|||||||
<p>User <strong>{{ name }}</strong> made a payment.</p>
|
<p>User <strong>{{ name }}</strong> made a payment.</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
{{ additional_text }}
|
Plan: {{ planname }}, starting on {{ startdate }} and ending on {{ enddate }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Price: €{{ price }}.
|
Price: €{{ amount }}.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
|
|||||||
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Normal file
BIN
rowers/tests/testdata/testdata.tcx.gz
vendored
Normal file
Binary file not shown.
@@ -85,9 +85,6 @@ def billing_view(request):
|
|||||||
'planselectform':planselectform,
|
'planselectform':planselectform,
|
||||||
})
|
})
|
||||||
|
|
||||||
@user_passes_test(can_plan,login_url="/rowers/paidplans",
|
|
||||||
message="This functionality requires a Coach or Self-Coach plan",
|
|
||||||
redirect_field_name=None)
|
|
||||||
def buy_trainingplan_view(request,id=0):
|
def buy_trainingplan_view(request,id=0):
|
||||||
if not PAYMENT_PROCESSING_ON: # pragma: no cover # pragma: no cover
|
if not PAYMENT_PROCESSING_ON: # pragma: no cover # pragma: no cover
|
||||||
url = reverse('promembership')
|
url = reverse('promembership')
|
||||||
@@ -179,9 +176,7 @@ def buy_trainingplan_view(request,id=0):
|
|||||||
'form':form,
|
'form':form,
|
||||||
})
|
})
|
||||||
|
|
||||||
@user_passes_test(can_plan,login_url="/rowers/paidplans",
|
|
||||||
message="This functionality requires a Coach or Self-Coach plan",
|
|
||||||
redirect_field_name=None)
|
|
||||||
def purchase_checkouts_view(request):
|
def purchase_checkouts_view(request):
|
||||||
if not PAYMENT_PROCESSING_ON: # pragma: no cover # pragma: no cover
|
if not PAYMENT_PROCESSING_ON: # pragma: no cover # pragma: no cover
|
||||||
url = reverse('promembership')
|
url = reverse('promembership')
|
||||||
@@ -195,6 +190,13 @@ def purchase_checkouts_view(request):
|
|||||||
})
|
})
|
||||||
return HttpResponseRedirect(url)
|
return HttpResponseRedirect(url)
|
||||||
|
|
||||||
|
if r.rowerplan == 'freecoach':
|
||||||
|
messages.error(request,'You cannot purchase this training plan as a free coach member')
|
||||||
|
url = reverse('rower_view_instantplan',kwargs={
|
||||||
|
'id':plan.uuid,
|
||||||
|
})
|
||||||
|
return HttpResponseRedirect(url)
|
||||||
|
|
||||||
form = TrainingPlanBillingForm(request.POST)
|
form = TrainingPlanBillingForm(request.POST)
|
||||||
if form.is_valid():
|
if form.is_valid():
|
||||||
|
|
||||||
@@ -219,6 +221,14 @@ def purchase_checkouts_view(request):
|
|||||||
notes = data['notes']
|
notes = data['notes']
|
||||||
status = data['status']
|
status = data['status']
|
||||||
startdate = enddate-datetime.timedelta(days=plan.duration)
|
startdate = enddate-datetime.timedelta(days=plan.duration)
|
||||||
|
|
||||||
|
# upgrade rower
|
||||||
|
if r.rowerplan == 'basic':
|
||||||
|
messages.info(request,'You have been upgraded to the Self-Coach plan for the duration of the plan')
|
||||||
|
r.rowerplan = 'plan'
|
||||||
|
r.planexpires = enddate
|
||||||
|
r.save()
|
||||||
|
|
||||||
p = TrainingPlan(
|
p = TrainingPlan(
|
||||||
name=name,
|
name=name,
|
||||||
#target=target,
|
#target=target,
|
||||||
@@ -233,6 +243,15 @@ def purchase_checkouts_view(request):
|
|||||||
p.rowers.add(r)
|
p.rowers.add(r)
|
||||||
|
|
||||||
create_sessions_from_json(plansteps,r,startdate,r.user)
|
create_sessions_from_json(plansteps,r,startdate,r.user)
|
||||||
|
print('aap')
|
||||||
|
job = myqueue(queuehigh,handle_send_email_instantplan_notification,
|
||||||
|
r.user.username,
|
||||||
|
r.user.email,
|
||||||
|
plan.price,
|
||||||
|
plan.name,
|
||||||
|
startdate,
|
||||||
|
enddate)
|
||||||
|
print(job,'noot')
|
||||||
|
|
||||||
url = reverse('plannedsessions_view')
|
url = reverse('plannedsessions_view')
|
||||||
timeperiod = startdate.strftime('%Y-%m-%d')+'/'+enddate.strftime('%Y-%m-%d')
|
timeperiod = startdate.strftime('%Y-%m-%d')+'/'+enddate.strftime('%Y-%m-%d')
|
||||||
@@ -266,9 +285,6 @@ def purchase_checkouts_view(request):
|
|||||||
})
|
})
|
||||||
return HttpResponseRedirect(url) # pragma: no cover
|
return HttpResponseRedirect(url) # pragma: no cover
|
||||||
|
|
||||||
@user_passes_test(can_plan,login_url="/rowers/paidplans",
|
|
||||||
message="This functionality requires a Coach or Self-Coach plan",
|
|
||||||
redirect_field_name=None)
|
|
||||||
def confirm_trainingplan_purchase_view(request,id = 0):
|
def confirm_trainingplan_purchase_view(request,id = 0):
|
||||||
if not PAYMENT_PROCESSING_ON: # pragma: no cover # pragma: no cover
|
if not PAYMENT_PROCESSING_ON: # pragma: no cover # pragma: no cover
|
||||||
url = reverse('promembership')
|
url = reverse('promembership')
|
||||||
|
|||||||
@@ -2615,8 +2615,8 @@ def rower_view_instantplan(request,id='',userid=0):
|
|||||||
).order_by("-date")
|
).order_by("-date")
|
||||||
|
|
||||||
if request.method == 'POST' and not request.user.is_anonymous:
|
if request.method == 'POST' and not request.user.is_anonymous:
|
||||||
if not can_plan(request.user): # pragma: no cover
|
if not can_plan(request.user) and plan.price == 0: # pragma: no cover
|
||||||
messages.error(request,'You must be on a <a href="/rowers/paidplans">paid plan</a> to use this functionality')
|
messages.error(request,'You must be on a <a href="/rowers/paidplans">paid plan</a> to use free training plans')
|
||||||
url = reverse('rower_view_instantplan',kwargs={
|
url = reverse('rower_view_instantplan',kwargs={
|
||||||
'id':id,
|
'id':id,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -221,6 +221,7 @@ from rowers.tasks import (
|
|||||||
handle_sendemail_optout,
|
handle_sendemail_optout,
|
||||||
handle_sendemail_ical,
|
handle_sendemail_ical,
|
||||||
handle_c2_async_workout,
|
handle_c2_async_workout,
|
||||||
|
handle_send_email_instantplan_notification,
|
||||||
)
|
)
|
||||||
|
|
||||||
from scipy.signal import savgol_filter
|
from scipy.signal import savgol_filter
|
||||||
|
|||||||
Reference in New Issue
Block a user