mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2026-09-20 22:37:44 +00:00
Giant refactor to rebrand "SIG" as "Activity" anywhere that doesn't touch API or config file (which is to be addressed in a future breaking change). #147
This commit is contained in:
@@ -187,13 +187,13 @@ def alert_allowed_by_query(alert, query):
|
||||
if not alert.source or alert.source not in sources:
|
||||
return False
|
||||
case "sig":
|
||||
# If a list of sigs is provided, the alert must have a sig and it must match one of them.
|
||||
# The special "sig" "NO_SIG", when supplied in the list, mathches alerts with no sig.
|
||||
sigs = query.get(k).split(",")
|
||||
include_no_sig = "NO_SIG" in sigs
|
||||
if not alert.sig and not include_no_sig:
|
||||
# If a list of activities is provided, the alert must have an activity and it must match one of them.
|
||||
# The special activity "NO_SIG", when supplied in the list, matches alerts with no activity.
|
||||
activities = query.get(k).split(",")
|
||||
include_no_activity = "NO_SIG" in activities
|
||||
if not alert.sig and not include_no_activity:
|
||||
return False
|
||||
if alert.sig and alert.sig not in sigs:
|
||||
if alert.sig and alert.sig not in activities:
|
||||
return False
|
||||
case "dx_continent":
|
||||
dxconts = query.get(k).split(",")
|
||||
|
||||
Reference in New Issue
Block a user