-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix: App is blocked when onisep is down (#23)
fix: remove settings from `__init__.py`
- Loading branch information
1 parent
f8945ae
commit 4e4362e
Showing
3 changed files
with
51 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +0,0 @@ | ||
from enum import Enum | ||
import os | ||
|
||
from src.business_logic.formation.scrap.utils.get_onisep_token import ( | ||
BearerToken, | ||
get_token, | ||
) | ||
|
||
|
||
class HeaderKey(Enum): | ||
APPLICATION_ID = "Application-ID" | ||
AUTHORIZATION = "Authorization" | ||
|
||
|
||
ONISEP_URL = "https://api.opendata.onisep.fr/api/1.0/dataset/" | ||
|
||
HEADERS: dict[HeaderKey, BearerToken | str] = { | ||
HeaderKey.APPLICATION_ID.value: os.environ.get("ONISEP_APP_ID"), | ||
HeaderKey.AUTHORIZATION.value: get_token(), | ||
} | ||
20 changes: 18 additions & 2 deletions
20
src/business_logic/formation/scrap/utils/get_onisep_data.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters