diff options
| author | Adam Johnson <me@adamj.eu> | 2024-03-17 08:43:04 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-03-17 09:43:04 +0100 |
| commit | 7646b9023da7e1f6f3a871959db027b3ea36eebb (patch) | |
| tree | b0c15ba4935d43aae75a8d1236bd698f37556f0e /django | |
| parent | b07e2d57a000d98c73492e5242fed91d502a780a (diff) | |
Fixed #35301 -- Fixed Options._property_names for overriden properties.
Regression in faeb92ea13f0c1b2cc83f45b512f2c41cfb4f02d.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/options.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/django/db/models/options.py b/django/db/models/options.py index f842faf0da..ed7be7dd7a 100644 --- a/django/db/models/options.py +++ b/django/db/models/options.py @@ -969,12 +969,14 @@ class Options: def _property_names(self): """Return a set of the names of the properties defined on the model.""" names = set() + seen = set() for klass in self.model.__mro__: names |= { name for name, value in klass.__dict__.items() - if isinstance(value, property) + if isinstance(value, property) and name not in seen } + seen |= set(klass.__dict__) return frozenset(names) @cached_property |
