mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #28930 -- Simplified code with any() and all().
This commit is contained in:
committed by
Tim Graham
parent
c21f158295
commit
4c599ece57
@@ -106,10 +106,7 @@ class Signal:
|
||||
|
||||
with self.lock:
|
||||
self._clear_dead_receivers()
|
||||
for r_key, _ in self.receivers:
|
||||
if r_key == lookup_key:
|
||||
break
|
||||
else:
|
||||
if not any(r_key == lookup_key for r_key, _ in self.receivers):
|
||||
self.receivers.append((lookup_key, receiver))
|
||||
self.sender_receivers_cache.clear()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user