Skip to content

Commit

Permalink
Merge 287c79b into 55fb455
Browse files Browse the repository at this point in the history
  • Loading branch information
JulienPeloton committed Jul 17, 2023
2 parents 55fb455 + 287c79b commit da41acc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
2 changes: 2 additions & 0 deletions fink_filters/filter_anomaly_notification/filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ def anomaly_notification_(
t4_ = f'Real bogus: {round(row.rb, 2)}'
t5_ = f'Anomaly score: {round(row.anomaly_score, 2)}'
cutout, curve, cutout_perml, curve_perml = filter_utils.get_data_permalink_slack(row.objectId)
curve.seek(0)
cutout.seek(0)
cutout_perml = f"<{cutout_perml}|{' '}>"
curve_perml = f"<{curve_perml}|{' '}>"
tg_data.append((f'''{t1a}
Expand Down
6 changes: 1 addition & 5 deletions fink_filters/filter_anomaly_notification/filter_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

import io


def get_data_permalink_slack(ztf_id):
'''
Expand Down Expand Up @@ -68,11 +67,8 @@ def get_data_permalink_slack(ztf_id):
]
)
time.sleep(3)
curve.seek(0)
cutout.seek(0)
except SlackApiError as e:
if e.response["ok"] is False:
print(e.response['error'])
requests.post(
"https://api.telegram.org/bot" + os.environ['ANOMALY_TG_TOKEN'] + "/sendMessage",
data={
Expand Down Expand Up @@ -208,7 +204,7 @@ def msg_handler_tg(tg_data, channel_id, med):
res = requests.post(
method,
params={
"chat_id": "@fink_test",
"chat_id": channel_id,
"media": f'''[
{{
"type" : "photo",
Expand Down

0 comments on commit da41acc

Please sign in to comment.