diff --git a/monkey/monkey_island/cc/services/reporting/zero_trust_service.py b/monkey/monkey_island/cc/services/reporting/zero_trust_service.py index 594aba703..5a2045da5 100644 --- a/monkey/monkey_island/cc/services/reporting/zero_trust_service.py +++ b/monkey/monkey_island/cc/services/reporting/zero_trust_service.py @@ -65,7 +65,7 @@ class ZeroTrustService(object): worst_status = zero_trust_consts.STATUS_UNEXECUTED all_statuses = set() for test in principle_tests: - all_statuses |= set(Finding.objects(test=test).distinct("status")) + all_statuses |= set(Finding.objects(test=test).exclude('events').distinct("status")) for status in all_statuses: if zero_trust_consts.ORDERED_TEST_STATUSES.index(status) \ @@ -78,7 +78,7 @@ class ZeroTrustService(object): def __get_tests_status(principle_tests): results = [] for test in principle_tests: - test_findings = Finding.objects(test=test) + test_findings = Finding.objects(test=test).exclude('events') results.append( { "test": zero_trust_consts.TESTS_MAP[test][zero_trust_consts.TEST_EXPLANATION_KEY], diff --git a/monkey/monkey_island/cc/testing/profiler_decorator.py b/monkey/monkey_island/cc/testing/profiler_decorator.py index dd08eec2e..997ef91ae 100644 --- a/monkey/monkey_island/cc/testing/profiler_decorator.py +++ b/monkey/monkey_island/cc/testing/profiler_decorator.py @@ -6,12 +6,12 @@ PROFILER_LOG_DIR = "./profiler_logs/" def profile(sort_args=['cumulative'], print_args=[100]): - profiler = Profile() def decorator(fn): def inner(*args, **kwargs): result = None try: + profiler = Profile() result = profiler.runcall(fn, *args, **kwargs) finally: try: