MCPcopy Create free account
hub / github.com/vastsa/FileCodeBox / _activity_matches_keyword

Method _activity_matches_keyword

apps/admin/services.py:954–968  ·  view source on GitHub ↗
(self, activity: dict[str, Any], keyword: str)

Source from the content-addressed store, hash-verified

952 return filtered_activities
953
954 def _activity_matches_keyword(self, activity: dict[str, Any], keyword: str) -> bool:
955 searchable_values = [
956 activity.get("action"),
957 activity.get("targetType"),
958 activity.get("target_type"),
959 activity.get("targetId"),
960 activity.get("target_id"),
961 activity.get("targetName"),
962 activity.get("target_name"),
963 ]
964 meta = activity.get("meta")
965 if isinstance(meta, dict):
966 searchable_values.extend(meta.values())
967
968 return any(keyword in str(value or "").lower() for value in searchable_values)
969
970 def _build_admin_activity_options(
971 self,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected