Remove empty optgroups from language selector widget

This commit is contained in:
Richard Schreiber
2023-09-21 15:41:31 +02:00
parent acb35866ba
commit d7d419c826

View File

@@ -339,6 +339,7 @@ class MultipleLanguagesWidget(forms.CheckboxSelectMultiple):
filter_and_sort(self.choices, settings.LANGUAGES_INCUBATING)
)
)
self.choices = [c for c in self.choices if len(c[1])]
def options(self, name, value, attrs=None):
self.sort()