Skip to content

Commit

Permalink
remove block like on main
Browse files Browse the repository at this point in the history
  • Loading branch information
Theodlz committed Oct 5, 2023
1 parent 9601d1f commit 8e6b18c
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions kowalski/alert_brokers/alert_broker.py
Original file line number Diff line number Diff line change
Expand Up @@ -1803,37 +1803,6 @@ def alert_sentinel_skyportal(self, alert, prv_candidates, passed_filters):
# post alert photometry in single call to /api/photometry
alert["prv_candidates"] = prv_candidates

# also get all the alerts for this object, to make sure to have all the detections
try:
all_alerts = list(
retry(self.mongo.db[self.collection_alerts].find)(
{
"objectId": alert["objectId"],
"candid": {"$ne": alert["candid"]},
},
{
"candidate": 1,
},
)
)
all_alerts = [
{**a["candidate"]} for a in all_alerts if "candidate" in a
]
# add to prv_candidates the detections that are not already in there
# use the jd and the fid to match
for a in all_alerts:
if not any(
[
(a["jd"] == p["jd"]) and (a["fid"] == p["fid"])
for p in alert["prv_candidates"]
]
):
alert["prv_candidates"].append(a)
del all_alerts
except Exception as e:
# this should never happen, but just in case
log(f"Failed to get all alerts for {alert['objectId']}: {e}")

self.alert_put_photometry(alert)

if len(autosave_group_ids):
Expand Down

0 comments on commit 8e6b18c

Please sign in to comment.