try except na sort
This commit is contained in:
parent
9020f5551d
commit
eb2b861d48
1 changed files with 5 additions and 2 deletions
|
@ -56,8 +56,11 @@ def get_app_list(self, request, app_label=None):
|
||||||
|
|
||||||
|
|
||||||
# Sort the models alphabetically within each app.
|
# Sort the models alphabetically within each app.
|
||||||
for app in app_list:
|
try:
|
||||||
app['models'].sort(key=lambda x: locale.strxfrm(x['name'].lower()))
|
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
|
return app_list
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue