﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
17252	Multi-sort in admin does not respect initial admin_order_field	Sebastian Goll	nobody	"The multi-sort addition to the admin change list (introduced in #11868) fails to set the sort indicators for the default ordering in the following case: the model admin's `ordering` refers not to a proper field but to the name of a method with `admin_order_field` set. That method can either be defined in the model admin or the model itself, it doesn't matter.

The problem is easily fixed by the attached patch. We have to resolve the name that was given in `list_display` both when applying the actual ordering, as well as when getting the default ordering in case no explicit `ORDER_VAR` has yet been passed to the view.

Since the same functionality is required both within method `get_ordering` and `get_ordering_field_columns`, I moved the shared code to the new method `_get_admin_order_field` which simply does what the name indicates."	Bug	closed	contrib.admin	dev	Release blocker	fixed	multi-sort, admin, ordering		Accepted	1	0	0	1	1	1
