Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
fix(models): fix indexerror caused by django-multiselectfield
Browse files Browse the repository at this point in the history
  • Loading branch information
c0rydoras committed Apr 15, 2024
1 parent cbb6c15 commit 7f121ff
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions timed/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)

0 comments on commit 7f121ff

Please sign in to comment.