diff options
| author | Adam Johnson <me@adamj.eu> | 2022-01-13 18:51:18 +0000 |
|---|---|---|
| committer | Mariusz Felisiak <felisiak.mariusz@gmail.com> | 2022-01-14 07:00:48 +0100 |
| commit | fdfa97fb166ef5065aa2b229f19cb4ce303084e5 (patch) | |
| tree | 64850839d093016c3838638640c9774345fc937c /django | |
| parent | 652c68ffeebd510a6f59e1b56b3e007d07683ad8 (diff) | |
Fixed #33441 -- Restored immutability of models.Field.__hash__().
Regression in 502e75f9ed5476ffe8229109acf0c23999d4b533.
Diffstat (limited to 'django')
| -rw-r--r-- | django/db/models/fields/__init__.py | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index 88c9ca9f28..fcea1597ef 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -542,11 +542,7 @@ class Field(RegisterLookupMixin): return NotImplemented def __hash__(self): - return hash(( - self.creation_counter, - self.model._meta.app_label if hasattr(self, 'model') else None, - self.model._meta.model_name if hasattr(self, 'model') else None, - )) + return hash(self.creation_counter) def __deepcopy__(self, memodict): # We don't have to deepcopy very much here, since most things are not |
