diff --git a/participation/models.py b/participation/models.py index f6ece2d..7462010 100644 --- a/participation/models.py +++ b/participation/models.py @@ -237,7 +237,7 @@ class Team(models.Model): get_sympa_client().delete_list(f"equipe-{self.trigram}") def clean(self): - if len(self.trigram) != settings.TEAM_CODE_LENGTH: + if self.trigram and len(self.trigram) != settings.TEAM_CODE_LENGTH: raise ValidationError({'trigram': _("The team code must be composed of {nb_letters} uppercase letters.")}, params={'nb_letters': settings.TEAM_CODE_LENGTH}) return super().clean()