Skip to content

Commit

Permalink
Merge branch 'vgrange/open_hdf'
Browse files Browse the repository at this point in the history
* vgrange/open_hdf:
  vgrange/open_hdf
  • Loading branch information
dejafait committed Apr 27, 2020
2 parents 3bc35ff + a79d20a commit e1f3d90
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 23 deletions.
7 changes: 6 additions & 1 deletion itou/siaes/management/commands/import_deleted_siae.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
# Grand Est - note that department 67 was already open.
DEPARTMENTS_TO_OPEN_ON_20_04_2020 = ["08", "10", "51", "52", "54", "55", "57", "67", "68", "88"]

# Hauts-de-France - note that department 62 was already open.
DEPARTMENTS_TO_OPEN_ON_27_04_2020 = ["02", "59", "60", "62", "80"]


class Command(BaseCommand):
"""
Expand Down Expand Up @@ -60,6 +63,8 @@ class Command(BaseCommand):
14/04/2020: open Île-de-France (75, 77, 78, 91, 92, 93, 94, 95)
20/04/2020: open Grand Est (08, 10, 51, 52, 54, 55, 57, 67, 68, 88)
27/04/2020: open Hauts-de-France (02, 59, 60, 62, 80)
"""

help = "Restore deleted SIAEs data into the database."
Expand All @@ -86,7 +91,7 @@ def handle(self, dry_run=False, **options):

siae = Siae(**item["fields"])

if siae.department not in DEPARTMENTS_TO_OPEN_ON_20_04_2020:
if siae.department not in DEPARTMENTS_TO_OPEN_ON_27_04_2020:
continue

total_new_siaes += 1
Expand Down
30 changes: 8 additions & 22 deletions itou/siaes/management/commands/import_siae_2020_04_13.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@
import pandas as pd
from django.core.management.base import BaseCommand

from itou.siaes.management.commands.import_deleted_siae import (
DEPARTMENTS_TO_OPEN_ON_14_04_2020,
DEPARTMENTS_TO_OPEN_ON_20_04_2020,
DEPARTMENTS_TO_OPEN_ON_27_04_2020,
)
from itou.siaes.models import Siae
from itou.utils.address.departments import department_from_postcode
from itou.utils.apis.geocoding import get_geocoding_data
Expand All @@ -35,28 +40,9 @@

SIAE_CREATION_ALLOWED_KINDS = [Siae.KIND_ETTI]

SIAE_CREATION_ALLOWED_DEPARTMENTS = [
"62",
"67",
"75",
"77",
"78",
"91",
"92",
"93",
"94",
"95",
"08",
"10",
"51",
"52",
"54",
"55",
"57",
"67",
"68",
"88",
]
SIAE_CREATION_ALLOWED_DEPARTMENTS = (
DEPARTMENTS_TO_OPEN_ON_14_04_2020 + DEPARTMENTS_TO_OPEN_ON_20_04_2020 + DEPARTMENTS_TO_OPEN_ON_27_04_2020
)

EXPECTED_KINDS = [Siae.KIND_ETTI, Siae.KIND_ACI, Siae.KIND_EI, Siae.KIND_AI]

Expand Down

0 comments on commit e1f3d90

Please sign in to comment.