Private
Public Access
1
0

some fixes

This commit is contained in:
Sander Roosendaal
2020-01-15 11:08:32 +01:00
parent a6746030e9
commit 88703bb34e
4 changed files with 17 additions and 11 deletions

View File

@@ -904,11 +904,11 @@ class Rower(models.Model):
def get_coaches(self):
coaches = []
for group in self.coachinggroups.all():
try:
coach = Rower.objects.get(mycoachgroup=group)
coaches.append(coach)
except Rower.DoesNotExist:
pass
try:
coach = Rower.objects.get(mycoachgroup=group)
coaches.append(coach)
except Rower.DoesNotExist:
pass
return coaches
@@ -2665,7 +2665,7 @@ class Workout(models.Model):
def save(self, *args, **kwargs):
user = self.user
if not can_add_workout(self.user):
if not can_add_workout(user.user):
raise forms.ValidationError("Free Coach User cannot have any workouts")
super(Workout, self).save(*args, **kwargs)