mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Fixed #31538 -- Fixed Meta.ordering validation lookups that are not transforms.
Regression in 440505cb2c.
Thanks Simon Meers for the report.
This commit is contained in:
@@ -1747,7 +1747,9 @@ class Model(metaclass=ModelBase):
|
||||
else:
|
||||
_cls = None
|
||||
except (FieldDoesNotExist, AttributeError):
|
||||
if fld is None or fld.get_transform(part) is None:
|
||||
if fld is None or (
|
||||
fld.get_transform(part) is None and fld.get_lookup(part) is None
|
||||
):
|
||||
errors.append(
|
||||
checks.Error(
|
||||
"'ordering' refers to the nonexistent field, "
|
||||
|
||||
Reference in New Issue
Block a user