From 33062b8bdbdb240f4b6792031d957a91bbde4ff8 Mon Sep 17 00:00:00 2001 From: terrtia Date: Tue, 13 Aug 2024 11:43:05 +0200 Subject: [PATCH] fix: [tracker] firce delete objects filter on edit --- bin/lib/Tracker.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/lib/Tracker.py b/bin/lib/Tracker.py index 3d46c1f1..18abb07d 100755 --- a/bin/lib/Tracker.py +++ b/bin/lib/Tracker.py @@ -215,6 +215,8 @@ def set_filters(self, filters): def del_filters(self, tracker_type, to_track): filters = self.get_filters() + if not filters: + filters = get_objects_tracked() for obj_type in filters: r_tracker.srem(f'trackers:objs:{tracker_type}:{obj_type}', to_track) r_tracker.srem(f'trackers:uuid:{tracker_type}:{to_track}', f'{self.uuid}:{obj_type}') @@ -541,12 +543,12 @@ def edit(self, tracker_type, to_track, level, description=None, filters={}, tags r_tracker.sadd(f'trackers:objs:{tracker_type}:{obj_type}', to_track) r_tracker.sadd(f'trackers:uuid:{tracker_type}:{to_track}', f'{self.uuid}:{obj_type}') + self._set_field('last_change', time.time()) + # Refresh Trackers trigger_trackers_refresh(tracker_type) if tracker_type != old_type: trigger_trackers_refresh(old_type) - - self._set_field('last_change', time.time()) return self.uuid def delete(self):