Skip to content

Commit

Permalink
fix: [tracker] firce delete objects filter on edit
Browse files Browse the repository at this point in the history
  • Loading branch information
Terrtia committed Aug 13, 2024
1 parent 8ffde96 commit 33062b8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions bin/lib/Tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}')
Expand Down Expand Up @@ -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):
Expand Down

0 comments on commit 33062b8

Please sign in to comment.