From d84db949c6459521aa4d5be2d8157085c04f0119 Mon Sep 17 00:00:00 2001 From: Emmy D'Anello Date: Thu, 13 Jun 2024 11:03:10 +0200 Subject: [PATCH] Fix trigram validation Signed-off-by: Emmy D'Anello --- participation/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()