misc: drop support for django < 3.2 (#75681)
gitea/gadjo/pipeline/head There was a failure building this commit
Details
gitea/gadjo/pipeline/head There was a failure building this commit
Details
This commit is contained in:
parent
75f38ce67a
commit
c222e234cf
|
@ -1,4 +1,3 @@
|
|||
import django
|
||||
from django import forms
|
||||
|
||||
|
||||
|
@ -23,15 +22,8 @@ class MultiSelectWidget(forms.MultiWidget):
|
|||
self.widgets.append(forms.Select(attrs=self.attrs, choices=self.choices))
|
||||
|
||||
# all subwidgets must have the same name
|
||||
if django.VERSION >= (3, 1):
|
||||
self.widgets_names = [''] * len(self.widgets)
|
||||
return super().get_context(name, value, attrs)
|
||||
else:
|
||||
context = super().get_context(name, value, attrs)
|
||||
subwidgets = context['widget']['subwidgets']
|
||||
for widget in subwidgets:
|
||||
widget['name'] = widget['name'].rsplit('_', 1)[0]
|
||||
return context
|
||||
self.widgets_names = [''] * len(self.widgets)
|
||||
return super().get_context(name, value, attrs)
|
||||
|
||||
def decompress(self, value):
|
||||
return value or []
|
||||
|
|
Loading…
Reference in New Issue