team manager can edit workout
This commit is contained in:
@@ -302,7 +302,8 @@ def sendmail(request):
|
||||
def checkworkoutuser(user,workout):
|
||||
try:
|
||||
r = Rower.objects.get(user=user)
|
||||
return (workout.user == r)
|
||||
managers = [team.manager for team in workout.team.all()]
|
||||
return (workout.user == r or user in managers)
|
||||
except Rower.DoesNotExist:
|
||||
return(False)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user