fix: Limit group names to 80 characters

Fixes #6416
This commit is contained in:
Lars Eggert 2023-10-02 10:40:43 +03:00
parent d6f5564a82
commit 510570521d
No known key found for this signature in database
GPG key ID: 54B5C309BF70C157

View file

@ -35,6 +35,13 @@ class GroupFactory(factory.django.DjangoModelFactory):
uses_milestone_dates = True uses_milestone_dates = True
used_roles = [] # type: List[str] 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 @factory.lazy_attribute
def parent(self): def parent(self):
if self.type_id in ['wg','ag']: if self.type_id in ['wg','ag']: