Before checking membership roles, we wait before the creation of the membership
This commit is contained in:
parent
76a6260b18
commit
12ebf9d12a
1 changed files with 7 additions and 6 deletions
|
|
@ -302,6 +302,7 @@ class Membership(models.Model):
|
||||||
if not Membership.objects.filter(user=self.user, club=self.club.parent_club).exists():
|
if not Membership.objects.filter(user=self.user, club=self.club.parent_club).exists():
|
||||||
raise ValidationError(_('User is not a member of the parent club') + ' ' + self.club.parent_club.name)
|
raise ValidationError(_('User is not a member of the parent club') + ' ' + self.club.parent_club.name)
|
||||||
|
|
||||||
|
if self.pk:
|
||||||
for role in self.roles.all():
|
for role in self.roles.all():
|
||||||
club = role.for_club
|
club = role.for_club
|
||||||
if club is not None:
|
if club is not None:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue