fix: apply ruff formatting to _check_levels_and_ignore_models_id
Fixes CI formatting failure introduced by the manual Sonar cognitive- complexity fix (extracting the levels/ignore_models_id check into its own helper). Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -450,7 +450,8 @@ class SlotManager(SientiaMonitoring):
|
||||
and notification_id not in ignore_list
|
||||
and key not in already_added_keys
|
||||
and self._check_levels_and_ignore_models_id(
|
||||
notification, levels_list, ignore_models_id_list)
|
||||
notification, levels_list, ignore_models_id_list
|
||||
)
|
||||
):
|
||||
receiver_groups[group_name]['notifications'].append(notification)
|
||||
already_added_keys.append(key)
|
||||
@@ -474,11 +475,13 @@ class SlotManager(SientiaMonitoring):
|
||||
levels_list (list, optional): List of levels to include. If None, all levels are included.
|
||||
ignore_models_id_list (list, optional): List of model_ids to exclude. If None, no models are excluded.
|
||||
|
||||
Returns:
|
||||
bool: True if the notification passes the checks, False otherwise.
|
||||
Returns:
|
||||
bool: True if the notification passes the checks, False otherwise.
|
||||
"""
|
||||
level_check = not levels_list or notification.get('level') in levels_list
|
||||
model_id_check = not ignore_models_id_list or notification.get('model_id') not in ignore_models_id_list
|
||||
model_id_check = (
|
||||
not ignore_models_id_list or notification.get('model_id') not in ignore_models_id_list
|
||||
)
|
||||
return level_check and model_id_check
|
||||
|
||||
@activity.defn(name='store_notification_cache')
|
||||
|
||||
Reference in New Issue
Block a user