Skip to content

Commit

Permalink
support no_tns_source_older_than parameter, that Kowalski can then se…
Browse files Browse the repository at this point in the history
…nd to Fritz to avoid autotriggers on objects that already have been reported on TNS a while ago
  • Loading branch information
Theodlz committed Oct 29, 2024
1 parent 89d2af0 commit c17a55e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions kowalski/alert_brokers/alert_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1623,6 +1623,22 @@ def alert_filter__user_defined(
), # by default we assume that update is implemented for the instrument of this allocation
}

if _filter["auto_followup"].get(
"no_tns_source_older_than", None
):
try:
passed_filter["auto_followup"]["data"][
"no_tns_source_older_than"
] = int(
_filter["auto_followup"][
"no_tns_source_older_than"
]
)
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,
"no_tns_source_older_than": int, # hours
"radius": float,
"validity_days": int,
"priority_order": str,
Expand Down

0 comments on commit c17a55e

Please sign in to comment.