diff --git a/kowalski/alert_brokers/alert_broker.py b/kowalski/alert_brokers/alert_broker.py index defe58da..817b8738 100644 --- a/kowalski/alert_brokers/alert_broker.py +++ b/kowalski/alert_brokers/alert_broker.py @@ -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" diff --git a/kowalski/api/handlers/filter.py b/kowalski/api/handlers/filter.py index c0971a0e..aa86488f 100644 --- a/kowalski/api/handlers/filter.py +++ b/kowalski/api/handlers/filter.py @@ -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,