From 0d78877bba0b5bcca193f3dc1ce9240d0cc18eee Mon Sep 17 00:00:00 2001 From: Arthur Deierlein Date: Mon, 15 Apr 2024 11:37:58 +0200 Subject: [PATCH] fix(models): fix indexerror caused by django-multiselectfield --- timed/models.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/timed/models.py b/timed/models.py index 93eb72b8..a615408d 100644 --- a/timed/models.py +++ b/timed/models.py @@ -2,6 +2,7 @@ from django.utils.translation import gettext_lazy as _ from multiselectfield import MultiSelectField +from multiselectfield.utils import get_max_length class WeekdaysField(MultiSelectField): @@ -27,4 +28,5 @@ class WeekdaysField(MultiSelectField): def __init__(self, *args, **kwargs): """Initialize multi select with choices weekdays.""" kwargs["choices"] = self.WEEKDAYS + kwargs["max_length"] = get_max_length(self.WEEKDAYS, None) super().__init__(*args, **kwargs)