This commit is contained in:
zandercymatics 2024-02-14 08:16:26 -07:00
parent ee41a8ac73
commit f55d5ef934
No known key found for this signature in database
GPG key ID: FF4636ABEC9682B7

View file

@ -56,6 +56,8 @@ class MultiFieldSortableChangeList(admin.views.main.ChangeList):
Mostly identical to the base implementation, except that now it can return
a list of order_field objects rather than just one.
"""
logger.info("timing get_ordering")
with Timer() as t:
params = self.params
ordering = list(self.model_admin.get_ordering(request) or self._get_default_ordering())
@ -913,14 +915,14 @@ class DomainApplicationAdmin(ListHeaderAdmin):
# lists in filter_horizontal are not sorted properly, sort them
# by website
def formfield_for_manytomany(self, db_field, request, **kwargs):
logger.info("timing formfield_for_manytomany")
logger.info(f"timing formfield_for_manytomany -> {db_field.name}")
with Timer() as t:
if db_field.name in {"current_websites", "alternative_domains"}:
kwargs["queryset"] = models.Website.objects.all().order_by("website") # Sort websites
return super().formfield_for_manytomany(db_field, request, **kwargs)
def formfield_for_foreignkey(self, db_field, request, **kwargs):
logger.info("timing formfield_for_foreignkey")
logger.info(f"timing formfield_for_foreignkey -> {db_field.name}")
with Timer() as t:
# Removes invalid investigator options from the investigator dropdown
if db_field.name == "investigator":