mirror of
				https://gitlab.crans.org/bde/nk20
				synced 2025-10-31 15:50:03 +01:00 
			
		
		
		
	Check that the user is a member of the parent club only at the creation of the membership
This commit is contained in:
		| @@ -384,7 +384,8 @@ class Membership(models.Model): | ||||
|             ).exists(): | ||||
|                 raise ValidationError(_('User is already a member of the club')) | ||||
|  | ||||
|             if self.club.parent_club is not None: | ||||
|             if self.club.parent_club is not None and not self.pk: | ||||
|                 # Check that the user is already a member of the parent club if the membership is created | ||||
|                 if not Membership.objects.filter( | ||||
|                     user=self.user, | ||||
|                     club=self.club.parent_club, | ||||
|   | ||||
		Reference in New Issue
	
	Block a user