summaryrefslogtreecommitdiff
path: root/django/contrib/messages/storage/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'django/contrib/messages/storage/base.py')
-rw-r--r--django/contrib/messages/storage/base.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/contrib/messages/storage/base.py b/django/contrib/messages/storage/base.py
index fd5d0c24aa..b2eeac77f4 100644
--- a/django/contrib/messages/storage/base.py
+++ b/django/contrib/messages/storage/base.py
@@ -25,8 +25,9 @@ class Message:
self.extra_tags = str(self.extra_tags) if self.extra_tags is not None else None
def __eq__(self, other):
- return isinstance(other, Message) and self.level == other.level and \
- self.message == other.message
+ if not isinstance(other, Message):
+ return NotImplemented
+ return self.level == other.level and self.message == other.message
def __str__(self):
return str(self.message)