Selaa lähdekoodia

Sort the list for consistent output

Sander Steffann 6 vuotta sitten
vanhempi
commit
b26fc81187
1 muutettua tiedostoa jossa 1 lisäystä ja 0 poistoa
  1. 1 0
      netbox/utilities/metadata.py

+ 1 - 0
netbox/utilities/metadata.py

@@ -15,4 +15,5 @@ class ContentTypeMetadata(SimpleMetadata):
                 }
                 for choice_value, choice_name in field.choices.items()
             ]
+            field_info['choices'].sort(key=lambda item: item['display_name'])
         return field_info