maps: sort icon labels in new layer page (#21567)

This commit is contained in:
Frédéric Péters 2018-01-31 23:05:17 +01:00
parent 44f198df2a
commit 19c73ccc72
1 changed files with 6 additions and 0 deletions

View File

@ -50,6 +50,12 @@ class MapNewLayerForm(forms.ModelForm):
}
def __init__(self, *args, **kwargs):
super(MapNewLayerForm, self).__init__(*args, **kwargs)
self.fields['icon'].choices = list(
sorted(self.fields['icon'].choices, key=lambda x: force_text(x[1])))
class MapLayerForm(forms.ModelForm):
class Meta:
model = MapLayer