Private
Public Access
1
0

adding coach trial functionality

This commit is contained in:
Sander Roosendaal
2022-08-24 13:32:53 +02:00
parent 85612b2a47
commit 936a524804
10 changed files with 140 additions and 15 deletions

View File

@@ -175,7 +175,7 @@ def get_teams(request):
private='open').exclude(
rower=r).exclude(manager=request.user).order_by('name')
if r.rowerplan == 'basic':
if user_is_basic(request.user):
otherteams = otherteams.filter(manager__rower__rowerplan='coach')
return myteams, memberteams, otherteams
@@ -234,7 +234,7 @@ def rower_teams_view(request): # pragma: no cover
coachees = teams.coach_getcoachees(request.user.rower)
if request.user.rower.rowerplan == 'coach':
if is_coach(request.user) or is_coachtrial(request.user):
potentialathletes = Rower.objects.filter(
team__in=myteams).exclude(
user__in=invitedathletes).exclude(
@@ -471,7 +471,7 @@ def team_requestmembership_view(request, teamid, userid):
def request_coaching_view(request, coachid):
coach = User.objects.get(id=coachid).rower
if 'coach' in coach.rowerplan:
if is_coach(coach.user) or is_coachtrial(request.user):
res, text = teams.create_coaching_request(coach, request.user)
if res:
messages.info(request, text)