Skip to content

Commit

Permalink
bug with stream seek(0)
Browse files Browse the repository at this point in the history
  • Loading branch information
Knispel2 committed Jul 17, 2023
1 parent 3e50c38 commit 287c79b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 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
4 changes: 0 additions & 4 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

0 comments on commit 287c79b

Please sign in to comment.