Private
Public Access
1
0

changing can_coahc

This commit is contained in:
Sander Roosendaal
2021-03-17 08:57:24 +01:00
parent e1b0a8e8bb
commit affab72cd2
3 changed files with 12 additions and 4 deletions

View File

@@ -1117,6 +1117,17 @@ class Rower(models.Model):
return coaches
def can_coach(self):
if self.rowerplan not in ['coach','freecoach']:
return False
rs = Rower.objects.filter(coachinggroups__in=[self.mycoachgroup])
rekwests = CoachOffer.objects.filter(coach=self)
if len(rs)+len(rekwests) < self.clubsize and self.offercoaching:
return True
return False
@property
def ispaid(self):
return self.rowerplan in ['pro','plan','coach']