Skip to content

Commit

Permalink
autotrigger: not_if_tns_reported (#444)
Browse files Browse the repository at this point in the history
* support not_if_tns_reported parameter, that Kowalski can then send to Fritz to avoid autotriggers on objects that already have been reported on TNS a while ago
  • Loading branch information
Theodlz authored Nov 5, 2024
1 parent 89d2af0 commit 02d4b25
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
14 changes: 14 additions & 0 deletions kowalski/alert_brokers/alert_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,20 @@ def alert_filter__user_defined(
), # by default we assume that update is implemented for the instrument of this allocation
}

if _filter["auto_followup"].get(
"not_if_tns_reported", None
):
try:
passed_filter["auto_followup"]["data"][
"not_if_tns_reported"
] = int(
_filter["auto_followup"]["not_if_tns_reported"]
)
except Exception:
log(
f'Filter {_filter["fid"]} has an invalid auto-followup no_tns_older_than, skipping'
)

if not isinstance(_filter.get("autosave", False), bool):
passed_filter["auto_followup"]["data"][
"ignore_source_group_ids"
Expand Down
1 change: 1 addition & 0 deletions kowalski/api/handlers/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"payload": dict,
"target_group_ids": list,
"ignore_allocation_ids": list,
"not_if_tns_reported": int, # hours
"radius": float,
"validity_days": int,
"priority_order": str,
Expand Down

0 comments on commit 02d4b25

Please sign in to comment.