Fix hashing with 4chan

This commit is contained in:
2022-08-30 10:00:26 +01:00
parent b8a08f9615
commit 38b712ac9a
3 changed files with 22 additions and 9 deletions

View File

@@ -374,13 +374,14 @@ class DrilldownContextModal(APIView):
return render(request, self.template_name, results)
if settings.HASHING: # we probably want to see the tokens
if not request.user.has_perm("core.bypass_hashing"):
for index, item in enumerate(results["object_list"]):
if "tokens" in item:
results["object_list"][index]["msg"] = results["object_list"][
index
].pop("tokens")
# item["msg"] = item.pop("tokens")
if query_params["src"] not in settings.SAFE_SOURCES:
if not request.user.has_perm("core.bypass_hashing"):
for index, item in enumerate(results["object_list"]):
if "tokens" in item:
results["object_list"][index]["msg"] = results["object_list"][
index
].pop("tokens")
# item["msg"] = item.pop("tokens")
# Make the time nicer
# for index, item in enumerate(results["object_list"]):