Browse Source

try except na sort

strxfrm_pro_mac
ticvac 2 weeks ago
parent
commit
eb2b861d48
  1. 7
      mamweb/admin.py

7
mamweb/admin.py

@ -56,8 +56,11 @@ def get_app_list(self, request, app_label=None):
# Sort the models alphabetically within each app.
for app in app_list:
app['models'].sort(key=lambda x: locale.strxfrm(x['name'].lower()))
try:
for app in app_list:
app['models'].sort(key=lambda x: locale.strxfrm(x['name'].lower()))
except OSError:
pass # locale.strxfrm nefunguje na macu... :-/ -> neprovede se řazení
return app_list

Loading…
Cancel
Save