From 0a9368922a597a888816ef9f3be2b4a8e2d23b73 Mon Sep 17 00:00:00 2001 From: Thomas Rusiecki Date: Fri, 22 Nov 2024 17:47:01 -0300 Subject: [PATCH] snapshot correct indexing --- dashboard/views.py | 8 +------- evidence/parse.py | 4 +++- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/dashboard/views.py b/dashboard/views.py index 8d91732..8d96ddd 100644 --- a/dashboard/views.py +++ b/dashboard/views.py @@ -70,14 +70,8 @@ class SearchView(InventaryMixin): return self.search_hids(query, offset, limit) devices = [] - dev_id = [] - for x in matches: - # devices.append(self.get_annotations(x)) - dev = self.get_annotations(x) - if dev.id not in dev_id: - devices.append(dev) - dev_id.append(dev.id) + devices.append(self.get_annotations(x)) count = matches.size() # TODO fix of pagination, the count is not correct diff --git a/evidence/parse.py b/evidence/parse.py index fd68e06..26faec0 100644 --- a/evidence/parse.py +++ b/evidence/parse.py @@ -49,8 +49,10 @@ class Build: self.create_annotations() def index(self): + timestamp = self.json['timestamp'] snap = json.dumps(self.json) - index(self.user.institution, self.uuid, snap) + + index(self.user.institution, self.get_hid(self.json) , self.uuid, timestamp, snap) def generate_chids(self): self.algorithms = {