Skip to content

Commit

Permalink
access token fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Knispel2 committed Jun 25, 2024
1 parent ae52316 commit 0c37c9f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fink_filters/filter_anomaly_notification/filter_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ def load_to_anomaly_base(data, model):
'password': os.environ['ANOMALY_TG_TOKEN']
})
if status_check(res, 'load_to_anomaly_base_login'):
# TODO: Загрузка tg_id из базы
access_token = json.loads(res.text)['access_token']
tg_id_data = requests.get(url=f'https://fink.matwey.name:443/user/get_tgid/{username}')
if status_check(tg_id_data, 'tg_id loading'):
tg_id_data = tg_id_data.content.decode('utf-8')
Expand All @@ -318,7 +318,7 @@ def load_to_anomaly_base(data, model):
"ztf_id": ztf_id
}
headers = {
"Authorization": f"Bearer {json.loads(res.text)['access_token']}"
"Authorization": f"Bearer {access_token}"
}
response = requests.post('https://fink.matwey.name:443/images/upload', files=files, params=params, data=data,
headers=headers, timeout=10)
Expand Down

0 comments on commit 0c37c9f

Please sign in to comment.