Merge branch 'feature/freecoach2' into develop
This commit is contained in:
@@ -136,6 +136,8 @@ class RowerPlanMiddleWare(object):
|
||||
paymentprocessor='braintree')
|
||||
r.paidplan = basicplans[0]
|
||||
r.save()
|
||||
# remove from Free Coach groups
|
||||
|
||||
# send email
|
||||
job = myqueue(queue,
|
||||
handle_sendemail_expired,
|
||||
|
||||
@@ -878,7 +878,17 @@ class Rower(models.Model):
|
||||
def clean_email(self):
|
||||
return self.user.email.lower()
|
||||
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
try:
|
||||
for group in self.coachinggroups.all():
|
||||
coach = Rower.objects.get(mycoachgroup=group)
|
||||
if coach.rowerplan == 'freecoach':
|
||||
self.coachinggroups.remove(group)
|
||||
except ValueError:
|
||||
pass
|
||||
|
||||
super(Rower, self).save(*args, **kwargs)
|
||||
|
||||
class DeactivateUserForm(forms.ModelForm):
|
||||
class Meta:
|
||||
model = User
|
||||
|
||||
@@ -54,6 +54,14 @@
|
||||
|
||||
{% if team.manager == user %}
|
||||
<p>Use the form to add a new user. You can either select a user from the list of your existing club members who are not on this team yet, or you can type the user's email address, which also works for users who have not registered to the site yet.</p>
|
||||
{% if team.manager.rower.rowerplan == 'freecoach' %}
|
||||
<p>
|
||||
As a Free Coach user, your team members can only be users on a paid
|
||||
plan. You can also upgrade to a
|
||||
<a href="/rowers/paidplans/">Paid Coach Plan</a>
|
||||
which allows you to coach users on a free Rower Plan.
|
||||
</p>
|
||||
{% endif %}
|
||||
{% if inviteform.errors %}
|
||||
<p style="color: red;">
|
||||
Please correct the error{{ inviteform.errors|pluralize }} below.
|
||||
|
||||
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
BIN
rowers/tests/testdata/testdata.csv.gz
vendored
Binary file not shown.
Reference in New Issue
Block a user