From 8252d6b69ee1079a4a744f623c22dfddc1a8aaa1 Mon Sep 17 00:00:00 2001 From: Terrtia Date: Fri, 26 May 2023 14:09:12 +0200 Subject: [PATCH] fix: [tracker] fix tracker delete --- bin/lib/Tracker.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/bin/lib/Tracker.py b/bin/lib/Tracker.py index 1050d56b..2a5336ad 100755 --- a/bin/lib/Tracker.py +++ b/bin/lib/Tracker.py @@ -564,8 +564,20 @@ class Tracker: self._del_mails() self._del_tags() + + level = self.get_level() + + if level == 0: # user only + user = self.get_user() + r_tracker.srem(f'user:tracker:{user}', self.uuid) + r_tracker.srem(f'user:tracker:{user}:{tracker_type}', self.uuid) + elif level == 1: # global + r_tracker.srem('global:tracker', self.uuid) + r_tracker.srem(f'global:tracker:{tracker_type}', self.uuid) + # meta r_tracker.delete(f'tracker:{self.uuid}') + trigger_trackers_refresh(tracker_type) def create_tracker(tracker_type, to_track, user_id, level, description=None, filters={}, tags=[], mails=[], webhook=None, tracker_uuid=None):