events: cleanup function any (#23479)

old-commit-hash: 8eec818ae6
This commit is contained in:
Dean Lee 2022-01-10 21:32:07 +08:00 committed by GitHub
parent 08212107e8
commit 75d00872e8
1 changed files with 1 additions and 4 deletions

View File

@ -63,10 +63,7 @@ class Events:
self.events = self.static_events.copy() self.events = self.static_events.copy()
def any(self, event_type: str) -> bool: def any(self, event_type: str) -> bool:
for e in self.events: return any(event_type in EVENTS.get(e, {}) for e in self.events)
if event_type in EVENTS.get(e, {}).keys():
return True
return False
def create_alerts(self, event_types: List[str], callback_args=None): def create_alerts(self, event_types: List[str], callback_args=None):
if callback_args is None: if callback_args is None: