Skip to content
Snippets Groups Projects
Commit 13fbd75b authored by Jiří Kalvoda's avatar Jiří Kalvoda
Browse files

Export výsledků na web MO: přihlášení

parent 8f63adb9
No related branches found
No related tags found
1 merge request!117Publikace výsledkovky na web MO
......@@ -67,3 +67,5 @@ CURRENT_YEAR = 71
# Instance serveru Matematické olympiády, kam bude exportována výsledkovka
MO_WEB_SERVER = 'http://localhost:5001'
MO_WEB_LOGIN = 'matemaicky_hroch'
MO_WEB_PASSWD = 'BrumBrum'
......@@ -246,6 +246,8 @@ def handle_export_score_to_mo_web(the_job: TheJob):
'rows': json_rows,
}
auth = requests.auth.HTTPBasicAuth(config.MO_WEB_LOGIN, config.MO_WEB_PASSWD)
params = {
'season': round.year,
'category': round.category,
......@@ -258,6 +260,7 @@ def handle_export_score_to_mo_web(the_job: TheJob):
url=config.MO_WEB_SERVER + API_ENDPOINT_JSON,
params=params,
json=json,
auth=auth,
)
except requests.RequestException as e:
error(
......@@ -284,6 +287,7 @@ def handle_export_score_to_mo_web(the_job: TheJob):
params=params,
data=file,
headers=headers,
auth=auth,
)
except requests.RequestException as e:
error(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment