Private
Public Access
1
0

reinstalling club size

This commit is contained in:
Sander Roosendaal
2019-02-21 20:26:44 +01:00
parent fe59ead06b
commit 2c3d9532b0
4 changed files with 14 additions and 5 deletions

View File

@@ -119,7 +119,7 @@ def add_coach(coach,rower):
coach.mycoachgroup = coachgroup
coach.save()
if get_coach_club_size(coach)<=coach.clubsize:
if get_coach_club_size(coach)<coach.clubsize:
rower.coachinggroups.add(coach.mycoachgroup)
return (1,"Added Coach")
@@ -312,13 +312,15 @@ def create_coaching_offer(coach,user):
while code in codes:
code = uuid.uuid4().hex[:10].upper()
if coach.rowerplan == 'coach' and get_coach_club_size(coach)<=coach.clubsize:
if coach.rowerplan == 'coach' and get_coach_club_size(coach)<coach.clubsize:
rekwest = CoachOffer(coach=coach,user=user,code=code)
rekwest.save()
send_coacheerequest_email(rekwest)
return (rekwest.id,'The request was created')
elif get_coach_club_size(coach)>=coach.clubsize:
return(0,'You have reached the maximum number of athletes')
else:
return (0,'You are not a coach')