Private
Public Access
1
0

fixes for coach trial

This commit is contained in:
Sander Roosendaal
2022-09-04 17:53:16 +02:00
parent 936a524804
commit 86890a8a73
15 changed files with 97 additions and 54 deletions

View File

@@ -1235,11 +1235,14 @@ def iscoachmember(user):
r = Rower(user=user)
r.save()
result = user.is_authenticated and ('coach' in r.rowerplan)
else: # pragma: no cover
result = False
if user.is_authenticated:
if 'coach' in r.rowerplan:
return True
elif r.coachtrialexpires >= timezone.now().date():
return True
return result
return False
# More User/Rower utils