mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-07-28 00:49:49 +03:00
Fix NotImplemented code path to return NotImplemented itself.
This commit is contained in:
parent
1e1bce5c38
commit
c61c04a25f
|
@ -73,11 +73,12 @@ class ErrorDetail(str):
|
|||
|
||||
def __eq__(self, other):
|
||||
r = super().__eq__(other)
|
||||
|
||||
if r is NotImplemented:
|
||||
return r
|
||||
|
||||
try:
|
||||
if r is not NotImplemented:
|
||||
return r and self.code == other.code
|
||||
else:
|
||||
return self.code == other.code
|
||||
return r and self.code == other.code
|
||||
except AttributeError:
|
||||
return r
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user