mirror of
https://git.ianrenton.com/ian/spothole.git
synced 2025-10-27 08:49:27 +00:00
Toggle to allow DXpeditions to be displayed even if they exceed max_duration. Closes #17
This commit is contained in:
@@ -206,9 +206,12 @@ class WebServer:
|
||||
case "max_duration":
|
||||
max_duration = int(query.get(k))
|
||||
# Check the duration if end_time is provided. If end_time is not provided, assume the activation is
|
||||
# "short", i.e. it always passes this check.
|
||||
# "short", i.e. it always passes this check. If dxpeditions_skip_max_duration_check is true and
|
||||
# the alert is a dxpedition, it also always passes the check.
|
||||
dxpeditions_skip_check = bool(query.get(
|
||||
"dxpeditions_skip_max_duration_check")) if "dxpeditions_skip_max_duration_check" in query.keys() else False
|
||||
alerts = [a for a in alerts if (a.end_time and a.end_time - a.start_time <= max_duration) or
|
||||
not a.end_time]
|
||||
not a.end_time or (dxpeditions_skip_check and a.is_dxpedition)]
|
||||
case "source":
|
||||
sources = query.get(k).split(",")
|
||||
alerts = [a for a in alerts if a.source and a.source in sources]
|
||||
|
||||
Reference in New Issue
Block a user