Skip to content

Commit 0870b97

Browse files
committed
Modifications de l'indentation et ajout de variables d'environnement
1 parent f4c3a92 commit 0870b97

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

.editorconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,6 @@ indent_style = tab
1414

1515
[*.md]
1616
trim_trailing_whitespace = false
17+
18+
[*.py]
19+
indent_size = 4

src/import_ind.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
dotenv.load_dotenv()
99
sesame_api_baseurl = os.getenv('SESAME_API_BASEURL')
10+
sesame_api_token = os.getenv('SESAME_API_TOKEN')
1011

1112
configs = {
1213
"taiga_etd.json": {
@@ -109,14 +110,12 @@ async def sem_task(task):
109110
return await asyncio.gather(*[sem_task(task) for task in tasks])
110111

111112
async def send_request(session, url, json):
112-
token = os.getenv('SESAME_API_TOKEN')
113113
headers = {
114-
"Authorization": f"Bearer {token}",
114+
"Authorization": f"Bearer {sesame_api_token}",
115115
"Content-Type": "application/json; charset=utf-8",
116116
}
117117

118118
try:
119-
print(f"json: {json}")
120119
async with session.post(url, json=json, headers=headers) as response:
121120
response.raise_for_status() # Raises error for 4xx/5xx responses
122121
print(f"Request to {url} successful: {response.status}")

0 commit comments

Comments
 (0)