removing some remnants of coach and plan
This commit is contained in:
@@ -281,7 +281,7 @@ def update_subscription(rower, data, method='up'):
|
||||
_ = credits.upgrade(amount_int, rower)
|
||||
rower.planexpires = result.subscription.billing_period_end_date
|
||||
rower.teamplanexpires = result.subscription.billing_period_end_date
|
||||
rower.clubsize = plan.clubsize
|
||||
rower.clubsize = 10
|
||||
rower.paymenttype = plan.paymenttype
|
||||
rower.rowerplan = plan.shortname
|
||||
rower.subscription_id = result.subscription.id
|
||||
@@ -293,19 +293,18 @@ def update_subscription(rower, data, method='up'):
|
||||
l=rower.user.last_name,
|
||||
)
|
||||
|
||||
if rower.paidplan != 'coach':
|
||||
try:
|
||||
coachgroup = rower.mycoachgroup
|
||||
except CoachingGroup.DoesNotExist: # pragma: no cover
|
||||
coachgroup = CoachingGroup()
|
||||
coachgroup.save()
|
||||
rower.mycoachgroup = coachgroup
|
||||
rower.save()
|
||||
try:
|
||||
coachgroup = rower.mycoachgroup
|
||||
except CoachingGroup.DoesNotExist: # pragma: no cover
|
||||
coachgroup = CoachingGroup()
|
||||
coachgroup.save()
|
||||
rower.mycoachgroup = coachgroup
|
||||
rower.save()
|
||||
|
||||
athletes = Rower.objects.filter(
|
||||
coachinggroups__in=[rower.mycoachgroup]).distinct()
|
||||
for athlete in athletes: # pragma: no cover
|
||||
athlete.coachinggroups.remove(rower.mycoachgroup)
|
||||
athletes = Rower.objects.filter(
|
||||
coachinggroups__in=[rower.mycoachgroup]).distinct()
|
||||
for athlete in athletes: # pragma: no cover
|
||||
athlete.coachinggroups.remove(rower.mycoachgroup)
|
||||
|
||||
if method == 'up':
|
||||
transactions = result.subscription.transactions
|
||||
|
||||
Reference in New Issue
Block a user