mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Add __hash__
method for permissions.OperandHolder
class (#9417)
`OperandHolder` is not hashable, so need to add `__hash__` method
This commit is contained in:
parent
fbdab09c77
commit
fe92f0dd0d
|
@ -54,6 +54,9 @@ class OperandHolder(OperationHolderMixin):
|
||||||
self.op2_class == other.op2_class
|
self.op2_class == other.op2_class
|
||||||
)
|
)
|
||||||
|
|
||||||
|
def __hash__(self):
|
||||||
|
return hash((self.operator_class, self.op1_class, self.op2_class))
|
||||||
|
|
||||||
|
|
||||||
class AND:
|
class AND:
|
||||||
def __init__(self, op1, op2):
|
def __init__(self, op1, op2):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user