Private
Public Access
1
0

fixing bug creating teams for trial users

This commit is contained in:
Sander Roosendaal
2020-04-06 09:46:59 +02:00
parent 47effe503e
commit 1b8185b2c7
6 changed files with 20 additions and 18 deletions

View File

@@ -363,10 +363,12 @@ class Team(models.Model):
"Basic user cannot be team manager"
)
if not can_add_team(manager):
raise ValidationError(
"Pro and Self-Coach users cannot have more than one team"
)
if not self.id:
# new model instance
if not can_add_team(manager):
raise ValidationError(
"Pro and Self-Coach users cannot have more than one team"
)
super(Team, self).save(*args,**kwargs)