Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(API Entreprise): Mise à jour des appels pour fonctionner sur la v3 de l'api #1599

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -507,7 +507,7 @@
# API Entreprise.
# https://dashboard.entreprise.api.gouv.fr/login (login is done through auth.api.gouv.fr)
# https://doc.entreprise.api.gouv.fr/
API_ENTREPRISE_BASE_URL = "https://entreprise.api.gouv.fr/v2"
API_ENTREPRISE_BASE_URL = env.str("API_ENTREPRISE_BASE_URL", "https://entreprise.api.gouv.fr/v3")
API_ENTREPRISE_CONTEXT = "emplois.inclusion.beta.gouv.fr"
API_ENTREPRISE_RECIPIENT = env.str("API_ENTREPRISE_RECIPIENT", "")
API_ENTREPRISE_TOKEN = env.str("API_ENTREPRISE_TOKEN", "")
Expand Down
4 changes: 4 additions & 0 deletions env.default.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,7 @@ export OPENAI_API_BASE=""
export OPENAI_API_KEY=""
export OPENAI_MODEL=""

# API Entreprise / see https://entreprise.api.gouv.fr/developpeurs#kit-de-mise-en-production
export API_ENTREPRISE_RECIPIENT=""
export API_ENTREPRISE_BASE_URL="https://staging.entreprise.api.gouv.fr/v3"
export API_ENTREPRISE_TOKEN=""
12 changes: 5 additions & 7 deletions env.docker_default.local
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,10 @@ OPENAI_API_BASE=
OPENAI_API_BASE=
OPENAI_MODEL=

# ELASTICSEARCH
ELASTICSEARCH_HOST=
ELASTICSEARCH_USERNAME=
ELASTICSEARCH_PASSWORD=
ELASTICSEARCH_INDEX_SIAES=
ELASTICSEARCH_MIN_SCORE=0.9

# DATACUBE API
DATACUBE_API_TOKEN=

# API Entreprise / see https://entreprise.api.gouv.fr/developpeurs#kit-de-mise-en-production
API_ENTREPRISE_RECIPIENT=
API_ENTREPRISE_BASE_URL="https://staging.entreprise.api.gouv.fr/v3"
API_ENTREPRISE_TOKEN=
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import time

from django.db.models import Q
from sentry_sdk.crons import monitor

from lemarche.siaes.models import Siae
from lemarche.utils.apis import api_slack
Expand Down Expand Up @@ -33,6 +34,7 @@ def add_arguments(self, parser):
parser.add_argument("--siret", type=str, default=None, help="Lancer sur un Siret spécifique")
parser.add_argument("--limit", type=int, default=None, help="Limiter le nombre de structures à processer")

@monitor(monitor_slug="update-api-entreprise-fields")
def handle(self, *args, **options):
self.stdout_info("-" * 80)
self.stdout_info("Populating API Entreprise fields...")
Expand Down
Loading
Loading