Skip to content

Commit

Permalink
remove useless API entreprise enrich because it's done by a cron
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastienReuiller committed Oct 20, 2023
1 parent 8f9f56e commit 6afe93d
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions lemarche/siaes/management/commands/import_esat_from_asp.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

from lemarche.siaes import constants as siae_constants
from lemarche.siaes.models import Siae
from lemarche.utils.apis.api_entreprise import etablissement_get_or_error # exercice_get_or_error
from lemarche.utils.apis.geocoding import get_geocoding_data
from lemarche.utils.constants import DEPARTMENT_TO_REGION, department_from_postcode
from lemarche.utils.data import rename_dict_key
Expand Down Expand Up @@ -137,20 +136,6 @@ def import_esat(self, esat): # noqa C901
rename_dict_key(esat, "N° de Siret", "siret")
esat["siret_is_valid"] = True

# enrich with API Entreprise
etablissement, error = etablissement_get_or_error(
esat["siret"], reason="Mise à jour données Marché de la plateforme de l'Inclusion"
)
if etablissement:
print(etablissement)
esat["nature"] = Siae.NATURE_HEAD_OFFICE if etablissement["is_head_office"] else Siae.NATURE_ANTENNA
esat["is_active"] = False if etablissement["is_closed"] else True
esat["naf"] = etablissement["naf"]
if etablissement["employees"]:
esat["api_entreprise_employees"] = etablissement["employees"]
if etablissement["date_constitution"]:
esat["api_entreprise_date_constitution"] = etablissement["date_constitution"]

full_address = esat.pop("Adresse")

# create object
Expand Down

0 comments on commit 6afe93d

Please sign in to comment.