Implement notification rules and settings

This commit is contained in:
2023-01-12 07:20:43 +00:00
parent a70bc16d22
commit f93d37d1c0
18 changed files with 545 additions and 77 deletions

View File

@@ -5,9 +5,8 @@ from pprint import pprint
import requests
from django.conf import settings
from core.db import StorageBackend
from core.db import StorageBackend, add_defaults, dedup_list
from core.db.processing import annotate_results, parse_results
from core.views import helpers
logger = logging.getLogger(__name__)
@@ -67,7 +66,7 @@ class ManticoreBackend(StorageBackend):
sort = None
query_created = False
source = None
helpers.add_defaults(query_params)
add_defaults(query_params)
# Check size
if request.user.is_anonymous:
sizes = settings.MANTICORE_MAIN_SIZES_ANON
@@ -292,7 +291,7 @@ class ManticoreBackend(StorageBackend):
if dedup:
if not dedup_fields:
dedup_fields = ["msg", "nick", "ident", "host", "net", "channel"]
results_parsed = helpers.dedup_list(results_parsed, dedup_fields)
results_parsed = dedup_list(results_parsed, dedup_fields)
context = {
"object_list": results_parsed,
"card": results["hits"]["total"],