From 510570521dcc0031810463537f0fa681849642d8 Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Mon, 2 Oct 2023 10:40:43 +0300 Subject: [PATCH] fix: Limit group names to 80 characters Fixes #6416 --- ietf/group/factories.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ietf/group/factories.py b/ietf/group/factories.py index 0be81b965..4cdaa0848 100644 --- a/ietf/group/factories.py +++ b/ietf/group/factories.py @@ -35,6 +35,13 @@ class GroupFactory(factory.django.DjangoModelFactory): uses_milestone_dates = True used_roles = [] # type: List[str] + @classmethod + def _create(cls, model_class, *args, **kwargs): + obj = model_class(*args, **kwargs) + obj.name = obj.name[0:80] # db only allows names of 80 characters max + obj.save() + return obj + @factory.lazy_attribute def parent(self): if self.type_id in ['wg','ag']: