mirror of
https://github.com/django/django.git
synced 2025-07-19 03:05:32 +00:00
Fixed #19634 -- Added proper __hash__ methods.
Classes overriding __eq__ need a __hash__ such that equal objects have the same hash. Thanks akaariai for the report and regebro for the patch.
This commit is contained in:
parent
0836670c5c
commit
e76147a83a
7 changed files with 24 additions and 16 deletions
|
@ -30,7 +30,6 @@ class FieldFile(File):
|
|||
return not self.__eq__(other)
|
||||
|
||||
def __hash__(self):
|
||||
# Required because we defined a custom __eq__.
|
||||
return hash(self.name)
|
||||
|
||||
# The standard File contains most of the necessary properties, but
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue