Fix „get_app_list() takes 2 positional arguments but 3 were given“

This commit is contained in:
Jonas Havelka 2023-12-04 10:51:28 +01:00
parent c55fbb9dca
commit 0fbfb1e3cd

View file

@ -35,13 +35,13 @@ locale.setlocale(locale.LC_COLLATE, 'cs_CZ.UTF-8')
# https://books.agiliq.com/projects/django-admin-cookbook/en/latest/set_ordering.html
# FIXME zpraseno pomocí toho, že Python umí bez problému přepisovat funkce
def get_app_list(self, request):
def get_app_list(self, request, app_label=None):
"""
Return a sorted list of all the installed apps that have been
registered in this site.
"""
app_dict = self._build_app_dict(request)
app_dict = self._build_app_dict(request, label=app_label)
# Sort the apps alphabetically.
app_list = sorted(app_dict.values(), key=lambda x: locale.strxfrm('!') if (x['name'] == "Seminar") else locale.strxfrm(x['name'].lower()))