mirror of
https://github.com/django/django.git
synced 2025-10-31 09:41:08 +00:00
Refs #30798 -- Prevented chaining fields from the same related model multiple times in model Meta.ordering.
This commit is contained in:
committed by
Mariusz Felisiak
parent
c2678e4975
commit
c7944628a1
@@ -1711,6 +1711,8 @@ class Model(metaclass=ModelBase):
|
||||
fld = _cls._meta.get_field(part)
|
||||
if fld.is_relation:
|
||||
_cls = fld.get_path_info()[-1].to_opts.model
|
||||
else:
|
||||
_cls = None
|
||||
except (FieldDoesNotExist, AttributeError):
|
||||
if fld is None or fld.get_transform(part) is None:
|
||||
errors.append(
|
||||
|
||||
Reference in New Issue
Block a user