Private
Public Access
1
0

fixed RQ issue - bg tasks now working on linux notebook

This commit is contained in:
Sander Roosendaal
2019-02-17 14:30:29 +01:00
parent 158a1e7956
commit f70b1a7ce5
6 changed files with 124 additions and 6 deletions

View File

@@ -171,9 +171,17 @@ def update_subscription(rower,data,method='up'):
)
if rower.paidplan != 'coach':
coachees = Rower.objects.filter(coach__in=[rower]).distinct()
for coachee in coachees:
coachee.coaches.remove(rower)
try:
coachgroup = coach.mycoachgroup
except CoachingGroup.DoesNotExist:
coachgroup = CoachingGroup()
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)
if method == 'up':
transactions = result.subscription.transactions