Private
Public Access
1
0

notifications for comments

This commit is contained in:
Sander Roosendaal
2017-05-11 15:24:55 +02:00
parent c6de8d9068
commit 1e7a833da1
4 changed files with 26 additions and 2 deletions

View File

@@ -327,7 +327,15 @@ class BaseFavoriteFormSet(BaseFormSet):
def checkworkoutuser(user,workout):
try:
r = Rower.objects.get(user=user)
return workout.user == r
teams = workout.team.all()
if workout.user == r:
return True
elif teams:
for team in teams:
if user == team.manager:
return True
else:
return False
except Rower.DoesNotExist:
return False