mirror of
https://github.com/django/django.git
synced 2025-01-08 17:37:20 +00:00
Update options.py
Fix issues if related_admin has annotations in get_queryset that are used in ordering.
This commit is contained in:
parent
7414704e88
commit
e78888af22
@ -250,7 +250,7 @@ class BaseModelAdmin(metaclass=forms.MediaDefiningClass):
|
|||||||
if related_admin is not None:
|
if related_admin is not None:
|
||||||
ordering = related_admin.get_ordering(request)
|
ordering = related_admin.get_ordering(request)
|
||||||
if ordering is not None and ordering != ():
|
if ordering is not None and ordering != ():
|
||||||
return db_field.remote_field.model._default_manager.using(db).order_by(
|
return related_admin.get_queryset(request).order_by(
|
||||||
*ordering
|
*ordering
|
||||||
)
|
)
|
||||||
return None
|
return None
|
||||||
|
Loading…
Reference in New Issue
Block a user