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:
Eduardo Rios
2026-09-15 14:39:59 -03:00
parent 86962c2cfc
commit 6a95b8d2df

View File

@@ -450,7 +450,8 @@ class SlotManager(SientiaMonitoring):
and notification_id not in ignore_list and notification_id not in ignore_list
and key not in already_added_keys and key not in already_added_keys
and self._check_levels_and_ignore_models_id( 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) receiver_groups[group_name]['notifications'].append(notification)
already_added_keys.append(key) 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. 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. ignore_models_id_list (list, optional): List of model_ids to exclude. If None, no models are excluded.
Returns: Returns:
bool: True if the notification passes the checks, False otherwise. bool: True if the notification passes the checks, False otherwise.
""" """
level_check = not levels_list or notification.get('level') in levels_list 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 return level_check and model_id_check
@activity.defn(name='store_notification_cache') @activity.defn(name='store_notification_cache')