-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed IndexError with Django 4.1 #132
Conversation
Great job! |
Nice ! Thank you very much for your work 👍 |
We might need to ask @goinnn if the project is actively maintained or if he needs help maintaining it 😉 |
Hi! @macmichael01! I have the same stopper to migrate my application to 4.1.1 version, The way that I could resolve without this change was add Now I have a suggenstion. Whay do you think if it assigns the max _length in the kwargs dictionary before to call This is the line where django assigns that validation: https://github.com/django/django/blob/main/django/db/models/fields/__init__.py#L1119 The code can look like: def __init__(self, *args, **kwargs):
self.min_choices = kwargs.pop('min_choices', None)
self.max_choices = kwargs.pop('max_choices', None)
choices = kwargs.get('kwargs', None)
kwargs.update({'max_length': get_max_length(choices, None)})
super(MultiSelectField, self).__init__(*args, **kwargs)
if self.min_choices is not None:
self.validators.append(MinChoicesValidator(self.min_choices))
if self.max_choices is not None:
self.validators.append(MaxChoicesValidator(self.max_choices)) |
@macmichael01 Any chance this can get reviewed and merged? |
Please merge this PR and release the bug fix |
@macmichael01 @goinnn please merge the PR. We have to do some Django upgrades and the plugin is blocking us. |
Does this need the condition that it is only appended if there are no other validators declared? Or would simply just appending it be a bit better so that it doesn't get left out. |
still experiencing this issue:) |
Fixed in #148. |
Fix for issue #131.