Skip to content

Commit

Permalink
👌 [#2262] PR feedback
Browse files Browse the repository at this point in the history
* prefix setup config settings
  • Loading branch information
stevenbal committed Mar 26, 2024
1 parent 864a04c commit 93b3be8
Show file tree
Hide file tree
Showing 8 changed files with 286 additions and 295 deletions.
6 changes: 2 additions & 4 deletions src/open_inwoner/cms/cases/views/status.py
Original file line number Diff line number Diff line change
Expand Up @@ -938,10 +938,8 @@ def register_by_api(self, form, config: OpenKlantConfig):
if ztc and ztc.contact_subject_code:
data["onderwerp"] = ztc.contact_subject_code

if contactmomenten_client := build_client_openklant("contactmomenten"):
contactmoment = contactmomenten_client.create_contactmoment(
data, klant=klant
)
if contactmoment_client := build_client_openklant("contactmomenten"):
contactmoment = contactmoment_client.create_contactmoment(data, klant=klant)
if contactmoment:
self.log_system_action(
"registered contactmoment by API", user=self.request.user
Expand Down
103 changes: 103 additions & 0 deletions src/open_inwoner/conf/app/setup_configuration.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
from ..utils import config

SETUP_CONFIGURATION_STEPS = [
"open_inwoner.configurations.bootstrap.zgw.ZakenAPIConfigurationStep",
"open_inwoner.configurations.bootstrap.zgw.CatalogiAPIConfigurationStep",
"open_inwoner.configurations.bootstrap.zgw.DocumentenAPIConfigurationStep",
"open_inwoner.configurations.bootstrap.zgw.FormulierenAPIConfigurationStep",
"open_inwoner.configurations.bootstrap.zgw.ZGWAPIsConfigurationStep",
"open_inwoner.configurations.bootstrap.kic.KlantenAPIConfigurationStep",
"open_inwoner.configurations.bootstrap.kic.ContactmomentenAPIConfigurationStep",
"open_inwoner.configurations.bootstrap.kic.KICAPIsConfigurationStep",
]
OIP_ORGANIZATION = config("OIP_ORGANIZATION", "")

# ZGW configuration variables
ZGW_CONFIG_ENABLE = config("ZGW_CONFIG_ENABLE", default=True)
ZGW_CONFIG_ZAKEN_API_ROOT = config("ZGW_CONFIG_ZAKEN_API_ROOT", "")
if ZGW_CONFIG_ZAKEN_API_ROOT and not ZGW_CONFIG_ZAKEN_API_ROOT.endswith("/"):
ZGW_CONFIG_ZAKEN_API_ROOT = f"{ZGW_CONFIG_ZAKEN_API_ROOT.strip()}/"
ZGW_CONFIG_ZAKEN_OAS_URL = ZGW_CONFIG_ZAKEN_API_ROOT # this is still required by the form, but not actually used
ZGW_CONFIG_ZAKEN_API_CLIENT_ID = config("ZGW_CONFIG_ZAKEN_API_CLIENT_ID", "")
ZGW_CONFIG_ZAKEN_API_SECRET = config("ZGW_CONFIG_ZAKEN_API_SECRET", "")
ZGW_CONFIG_CATALOGI_API_ROOT = config("ZGW_CONFIG_CATALOGI_API_ROOT", "")
if ZGW_CONFIG_CATALOGI_API_ROOT and not ZGW_CONFIG_CATALOGI_API_ROOT.endswith("/"):
ZGW_CONFIG_CATALOGI_API_ROOT = f"{ZGW_CONFIG_CATALOGI_API_ROOT.strip()}/"
ZGW_CONFIG_CATALOGI_OAS_URL = ZGW_CONFIG_CATALOGI_API_ROOT # this is still required by the form, but not actually used
ZGW_CONFIG_CATALOGI_API_CLIENT_ID = config("ZGW_CONFIG_CATALOGI_API_CLIENT_ID", "")
ZGW_CONFIG_CATALOGI_API_SECRET = config("ZGW_CONFIG_CATALOGI_API_SECRET", "")
ZGW_CONFIG_DOCUMENTEN_API_ROOT = config("ZGW_CONFIG_DOCUMENTEN_API_ROOT", "")
if ZGW_CONFIG_DOCUMENTEN_API_ROOT and not ZGW_CONFIG_DOCUMENTEN_API_ROOT.endswith("/"):
ZGW_CONFIG_DOCUMENTEN_API_ROOT = f"{ZGW_CONFIG_DOCUMENTEN_API_ROOT.strip()}/"
ZGW_CONFIG_DOCUMENTEN_OAS_URL = ZGW_CONFIG_DOCUMENTEN_API_ROOT # this is still required by the form, but not actually used
ZGW_CONFIG_DOCUMENTEN_API_CLIENT_ID = config("ZGW_CONFIG_DOCUMENTEN_API_CLIENT_ID", "")
ZGW_CONFIG_DOCUMENTEN_API_SECRET = config("ZGW_CONFIG_DOCUMENTEN_API_SECRET", "")
ZGW_CONFIG_FORMULIEREN_API_ROOT = config("ZGW_CONFIG_FORMULIEREN_API_ROOT", "")
if ZGW_CONFIG_FORMULIEREN_API_ROOT and not ZGW_CONFIG_FORMULIEREN_API_ROOT.endswith(
"/"
):
ZGW_CONFIG_FORMULIEREN_API_ROOT = f"{ZGW_CONFIG_FORMULIEREN_API_ROOT.strip()}/"
ZGW_CONFIG_FORMULIEREN_OAS_URL = ZGW_CONFIG_FORMULIEREN_API_ROOT # this is still required by the form, but not actually used
ZGW_CONFIG_FORMULIEREN_API_CLIENT_ID = config(
"ZGW_CONFIG_FORMULIEREN_API_CLIENT_ID", ""
)
ZGW_CONFIG_FORMULIEREN_API_SECRET = config("ZGW_CONFIG_FORMULIEREN_API_SECRET", "")
# ZGW config options
ZGW_CONFIG_ZAAK_MAX_CONFIDENTIALITY = config(
"ZGW_CONFIG_ZAAK_MAX_CONFIDENTIALITY", None
)
ZGW_CONFIG_DOCUMENT_MAX_CONFIDENTIALITY = config(
"ZGW_CONFIG_DOCUMENT_MAX_CONFIDENTIALITY", None
)
ZGW_CONFIG_ACTION_REQUIRED_DEADLINE_DAYS = config("ACTION_REQUIRED_DEADLINE_DAYS", None)
ZGW_CONFIG_ALLOWED_FILE_EXTENSIONS = config("ZGW_CONFIG_ALLOWED_FILE_EXTENSIONS", None)
ZGW_CONFIG_MIJN_AANVRAGEN_TITLE_TEXT = config(
"ZGW_CONFIG_MIJN_AANVRAGEN_TITLE_TEXT", None
)
ZGW_CONFIG_ENABLE_CATEGORIES_FILTERING_WITH_ZAKEN = config(
"ZGW_CONFIG_ENABLE_CATEGORIES_FILTERING_WITH_ZAKEN", None
)
ZGW_CONFIG_SKIP_NOTIFICATION_STATUSTYPE_INFORMEREN = config(
"ZGW_CONFIG_SKIP_NOTIFICATION_STATUSTYPE_INFORMEREN", None
)
ZGW_CONFIG_REFORMAT_ESUITE_ZAAK_IDENTIFICATIE = config(
"ZGW_CONFIG_REFORMAT_ESUITE_ZAAK_IDENTIFICATIE", None
)
ZGW_CONFIG_FETCH_EHERKENNING_ZAKEN_WITH_RSIN = config(
"ZGW_CONFIG_FETCH_EHERKENNING_ZAKEN_WITH_RSIN", None
)

# KIC configuration variables
KIC_CONFIG_ENABLE = config("KIC_CONFIG_ENABLE", default=True)
KIC_CONFIG_KLANTEN_API_ROOT = config("KIC_CONFIG_KLANTEN_API_ROOT", "")
if KIC_CONFIG_KLANTEN_API_ROOT and not KIC_CONFIG_KLANTEN_API_ROOT.endswith("/"):
KIC_CONFIG_KLANTEN_API_ROOT = f"{KIC_CONFIG_KLANTEN_API_ROOT.strip()}/"
KIC_CONFIG_KLANTEN_OAS_URL = KIC_CONFIG_KLANTEN_API_ROOT # this is still required by the form, but not actually used
KIC_CONFIG_KLANTEN_API_CLIENT_ID = config("KIC_CONFIG_KLANTEN_API_CLIENT_ID", "")
KIC_CONFIG_KLANTEN_API_SECRET = config("KIC_CONFIG_KLANTEN_API_SECRET", "")
KIC_CONFIG_CONTACTMOMENTEN_API_ROOT = config("KIC_CONFIG_CONTACTMOMENTEN_API_ROOT", "")
if (
KIC_CONFIG_CONTACTMOMENTEN_API_ROOT
and not KIC_CONFIG_CONTACTMOMENTEN_API_ROOT.endswith("/")
):
KIC_CONFIG_CONTACTMOMENTEN_API_ROOT = (
f"{KIC_CONFIG_CONTACTMOMENTEN_API_ROOT.strip()}/"
)
KIC_CONFIG_CONTACTMOMENTEN_OAS_URL = KIC_CONFIG_CONTACTMOMENTEN_API_ROOT # this is still required by the form, but not actually used
KIC_CONFIG_CONTACTMOMENTEN_API_CLIENT_ID = config(
"KIC_CONFIG_CONTACTMOMENTEN_API_CLIENT_ID", ""
)
KIC_CONFIG_CONTACTMOMENTEN_API_SECRET = config(
"KIC_CONFIG_CONTACTMOMENTEN_API_SECRET", ""
)
KIC_CONFIG_REGISTER_EMAIL = config("KIC_CONFIG_REGISTER_EMAIL", None)
KIC_CONFIG_REGISTER_CONTACT_MOMENT = config("KIC_CONFIG_REGISTER_CONTACT_MOMENT", None)
KIC_CONFIG_REGISTER_BRONORGANISATIE_RSIN = config(
"KIC_CONFIG_REGISTER_BRONORGANISATIE_RSIN", None
)
KIC_CONFIG_REGISTER_CHANNEL = config("KIC_CONFIG_REGISTER_CHANNEL", None)
KIC_CONFIG_REGISTER_TYPE = config("KIC_CONFIG_REGISTER_TYPE", None)
KIC_CONFIG_REGISTER_EMPLOYEE_ID = config("KIC_CONFIG_REGISTER_EMPLOYEE_ID", None)
KIC_CONFIG_USE_RSIN_FOR_INNNNPID_QUERY_PARAMETER = config(
"KIC_CONFIG_USE_RSIN_FOR_INNNNPID_QUERY_PARAMETER", None
)
87 changes: 1 addition & 86 deletions src/open_inwoner/conf/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -933,92 +933,7 @@
#
# django-setup-configuration
#
SETUP_CONFIGURATION_STEPS = [
"open_inwoner.configurations.bootstrap.zgw.ZakenAPIConfigurationStep",
"open_inwoner.configurations.bootstrap.zgw.CatalogiAPIConfigurationStep",
"open_inwoner.configurations.bootstrap.zgw.DocumentenAPIConfigurationStep",
"open_inwoner.configurations.bootstrap.zgw.FormulierenAPIConfigurationStep",
"open_inwoner.configurations.bootstrap.zgw.ZGWAPIsConfigurationStep",
"open_inwoner.configurations.bootstrap.kic.KlantenAPIConfigurationStep",
"open_inwoner.configurations.bootstrap.kic.ContactmomentenAPIConfigurationStep",
"open_inwoner.configurations.bootstrap.kic.KICAPIsConfigurationStep",
]
OIP_ORGANIZATION = config("OIP_ORGANIZATION", "")

# ZGW configuration variables
ZGW_API_CONFIG_ENABLE = config("ZGW_API_CONFIG_ENABLE", default=True)
ZAKEN_API_ROOT = config("ZAKEN_API_ROOT", "")
if ZAKEN_API_ROOT and not ZAKEN_API_ROOT.endswith("/"):
ZAKEN_API_ROOT = f"{ZAKEN_API_ROOT.strip()}/"
ZAKEN_OAS_URL = (
ZAKEN_API_ROOT # this is still required by the form, but not actually used
)
ZAKEN_API_CLIENT_ID = config("ZAKEN_API_CLIENT_ID", "")
ZAKEN_API_SECRET = config("ZAKEN_API_SECRET", "")
CATALOGI_API_ROOT = config("CATALOGI_API_ROOT", "")
if CATALOGI_API_ROOT and not CATALOGI_API_ROOT.endswith("/"):
CATALOGI_API_ROOT = f"{CATALOGI_API_ROOT.strip()}/"
CATALOGI_OAS_URL = (
CATALOGI_API_ROOT # this is still required by the form, but not actually used
)
CATALOGI_API_CLIENT_ID = config("CATALOGI_API_CLIENT_ID", "")
CATALOGI_API_SECRET = config("CATALOGI_API_SECRET", "")
DOCUMENTEN_API_ROOT = config("DOCUMENTEN_API_ROOT", "")
if DOCUMENTEN_API_ROOT and not DOCUMENTEN_API_ROOT.endswith("/"):
DOCUMENTEN_API_ROOT = f"{DOCUMENTEN_API_ROOT.strip()}/"
DOCUMENTEN_OAS_URL = (
DOCUMENTEN_API_ROOT # this is still required by the form, but not actually used
)
DOCUMENTEN_API_CLIENT_ID = config("DOCUMENTEN_API_CLIENT_ID", "")
DOCUMENTEN_API_SECRET = config("DOCUMENTEN_API_SECRET", "")
FORMULIEREN_API_ROOT = config("FORMULIEREN_API_ROOT", "")
if FORMULIEREN_API_ROOT and not FORMULIEREN_API_ROOT.endswith("/"):
FORMULIEREN_API_ROOT = f"{FORMULIEREN_API_ROOT.strip()}/"
FORMULIEREN_OAS_URL = (
FORMULIEREN_API_ROOT # this is still required by the form, but not actually used
)
FORMULIEREN_API_CLIENT_ID = config("FORMULIEREN_API_CLIENT_ID", "")
FORMULIEREN_API_SECRET = config("FORMULIEREN_API_SECRET", "")
# ZGW config options
ZAAK_MAX_CONFIDENTIALITY = config("ZAAK_MAX_CONFIDENTIALITY", None)
DOCUMENT_MAX_CONFIDENTIALITY = config("DOCUMENT_MAX_CONFIDENTIALITY", None)
ACTION_REQUIRED_DEADLINE_DAYS = config("ACTION_REQUIRED_DEADLINE_DAYS", None)
ALLOWED_FILE_EXTENSIONS = config("ALLOWED_FILE_EXTENSIONS", None)
MIJN_AANVRAGEN_TITLE_TEXT = config("MIJN_AANVRAGEN_TITLE_TEXT", None)
ENABLE_CATEGORIES_FILTERING_WITH_ZAKEN = config(
"ENABLE_CATEGORIES_FILTERING_WITH_ZAKEN", None
)
SKIP_NOTIFICATION_STATUSTYPE_INFORMEREN = config(
"SKIP_NOTIFICATION_STATUSTYPE_INFORMEREN", None
)
REFORMAT_ESUITE_ZAAK_IDENTIFICATIE = config("REFORMAT_ESUITE_ZAAK_IDENTIFICATIE", None)
FETCH_EHERKENNING_ZAKEN_WITH_RSIN = config("FETCH_EHERKENNING_ZAKEN_WITH_RSIN", None)

# KIC configuration variables
KIC_API_CONFIG_ENABLE = config("KIC_API_CONFIG_ENABLE", default=True)
KLANTEN_API_ROOT = config("KLANTEN_API_ROOT", "")
if KLANTEN_API_ROOT and not KLANTEN_API_ROOT.endswith("/"):
KLANTEN_API_ROOT = f"{KLANTEN_API_ROOT.strip()}/"
KLANTEN_OAS_URL = (
KLANTEN_API_ROOT # this is still required by the form, but not actually used
)
KLANTEN_API_CLIENT_ID = config("KLANTEN_API_CLIENT_ID", "")
KLANTEN_API_SECRET = config("KLANTEN_API_SECRET", "")
CONTACTMOMENTEN_API_ROOT = config("CONTACTMOMENTEN_API_ROOT", "")
if CONTACTMOMENTEN_API_ROOT and not CONTACTMOMENTEN_API_ROOT.endswith("/"):
CONTACTMOMENTEN_API_ROOT = f"{CONTACTMOMENTEN_API_ROOT.strip()}/"
CONTACTMOMENTEN_OAS_URL = CONTACTMOMENTEN_API_ROOT # this is still required by the form, but not actually used
CONTACTMOMENTEN_API_CLIENT_ID = config("CONTACTMOMENTEN_API_CLIENT_ID", "")
CONTACTMOMENTEN_API_SECRET = config("CONTACTMOMENTEN_API_SECRET", "")
KIC_REGISTER_EMAIL = config("KIC_REGISTER_EMAIL", None)
KIC_REGISTER_CONTACT_MOMENT = config("KIC_REGISTER_CONTACT_MOMENT", None)
KIC_REGISTER_BRONORGANISATIE_RSIN = config("KIC_REGISTER_BRONORGANISATIE_RSIN", None)
KIC_REGISTER_CHANNEL = config("KIC_REGISTER_CHANNEL", None)
KIC_REGISTER_TYPE = config("KIC_REGISTER_TYPE", None)
KIC_REGISTER_EMPLOYEE_ID = config("KIC_REGISTER_EMPLOYEE_ID", None)
KIC_USE_RSIN_FOR_INNNNPID_QUERY_PARAMETER = config(
"KIC_USE_RSIN_FOR_INNNNPID_QUERY_PARAMETER", None
)
from .app.setup_configuration import * # noqa

#
# Project specific settings
Expand Down
103 changes: 47 additions & 56 deletions src/open_inwoner/configurations/bootstrap/kic.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,40 +18,34 @@ class KlantenAPIConfigurationStep(BaseConfigurationStep):

verbose_name = "Klanten API configuration"
required_settings = [
"KLANTEN_API_ROOT",
"KLANTEN_API_CLIENT_ID",
"KLANTEN_API_SECRET",
"KIC_CONFIG_KLANTEN_API_ROOT",
"KIC_CONFIG_KLANTEN_API_CLIENT_ID",
"KIC_CONFIG_KLANTEN_API_SECRET",
]
enable_setting = "KIC_API_CONFIG_ENABLE"
enable_setting = "KIC_CONFIG_ENABLE"

def is_configured(self) -> bool:
return bool(Service.objects.filter(api_root=settings.KLANTEN_API_ROOT))
return Service.objects.filter(
api_root=settings.KIC_CONFIG_KLANTEN_API_ROOT
).exists()

def configure(self):
organization = settings.OIP_ORGANIZATION or settings.ENVIRONMENT
org_label = f"Open Inwoner {organization}".strip()

# 1. Create Klanten API service
klanten_service, created = Service.objects.update_or_create(
api_root=settings.KLANTEN_API_ROOT,
Service.objects.update_or_create(
api_root=settings.KIC_CONFIG_KLANTEN_API_ROOT,
defaults={
"label": "Klanten API",
"api_type": APITypes.kc,
"oas": settings.KLANTEN_API_ROOT,
"oas": settings.KIC_CONFIG_KLANTEN_API_ROOT,
"auth_type": AuthTypes.zgw,
"client_id": settings.KLANTEN_API_CLIENT_ID,
"secret": settings.KLANTEN_API_SECRET,
"user_id": settings.KLANTEN_API_CLIENT_ID,
"client_id": settings.KIC_CONFIG_KLANTEN_API_CLIENT_ID,
"secret": settings.KIC_CONFIG_KLANTEN_API_SECRET,
"user_id": settings.KIC_CONFIG_KLANTEN_API_CLIENT_ID,
"user_representation": org_label,
},
)
if not created:
klanten_service.oas = settings.KLANTEN_API_ROOT
klanten_service.client_id = settings.KLANTEN_API_CLIENT_ID
klanten_service.secret = settings.KLANTEN_API_SECRET
klanten_service.user_id = settings.KLANTEN_API_CLIENT_ID
klanten_service.user_representation = org_label
klanten_service.save()

def test_configuration(self):
"""
Expand All @@ -66,39 +60,34 @@ class ContactmomentenAPIConfigurationStep(BaseConfigurationStep):

verbose_name = "Contactmomenten API configuration"
required_settings = [
"CONTACTMOMENTEN_API_ROOT",
"CONTACTMOMENTEN_API_CLIENT_ID",
"CONTACTMOMENTEN_API_SECRET",
"KIC_CONFIG_CONTACTMOMENTEN_API_ROOT",
"KIC_CONFIG_CONTACTMOMENTEN_API_CLIENT_ID",
"KIC_CONFIG_CONTACTMOMENTEN_API_SECRET",
]
enable_setting = "KIC_API_CONFIG_ENABLE"
enable_setting = "KIC_CONFIG_ENABLE"

def is_configured(self) -> bool:
return bool(Service.objects.filter(api_root=settings.CONTACTMOMENTEN_API_ROOT))
return Service.objects.filter(
api_root=settings.KIC_CONFIG_CONTACTMOMENTEN_API_ROOT
).exists()

def configure(self):
organization = settings.OIP_ORGANIZATION or settings.ENVIRONMENT
org_label = f"Open Inwoner {organization}".strip()

contactmomenten_service, created = Service.objects.update_or_create(
api_root=settings.CONTACTMOMENTEN_API_ROOT,
Service.objects.update_or_create(
api_root=settings.KIC_CONFIG_CONTACTMOMENTEN_API_ROOT,
defaults={
"label": "Contactmomenten API",
"api_type": APITypes.cmc,
"oas": settings.CONTACTMOMENTEN_API_ROOT,
"oas": settings.KIC_CONFIG_CONTACTMOMENTEN_API_ROOT,
"auth_type": AuthTypes.zgw,
"client_id": settings.CONTACTMOMENTEN_API_CLIENT_ID,
"secret": settings.CONTACTMOMENTEN_API_SECRET,
"user_id": settings.CONTACTMOMENTEN_API_CLIENT_ID,
"client_id": settings.KIC_CONFIG_CONTACTMOMENTEN_API_CLIENT_ID,
"secret": settings.KIC_CONFIG_CONTACTMOMENTEN_API_SECRET,
"user_id": settings.KIC_CONFIG_CONTACTMOMENTEN_API_CLIENT_ID,
"user_representation": org_label,
},
)
if not created:
contactmomenten_service.oas = settings.CONTACTMOMENTEN_API_ROOT
contactmomenten_service.client_id = settings.CONTACTMOMENTEN_API_CLIENT_ID
contactmomenten_service.secret = settings.CONTACTMOMENTEN_API_SECRET
contactmomenten_service.user_id = settings.CONTACTMOMENTEN_API_CLIENT_ID
contactmomenten_service.user_representation = org_label
contactmomenten_service.save()

def test_configuration(self):
"""
Expand All @@ -112,7 +101,7 @@ class KICAPIsConfigurationStep(BaseConfigurationStep):
"""

verbose_name = "Klantinteractie APIs configuration"
enable_setting = "KIC_API_CONFIG_ENABLE"
enable_setting = "KIC_CONFIG_ENABLE"

def is_configured(self) -> bool:
kic_config = OpenKlantConfig.get_solo()
Expand All @@ -122,28 +111,30 @@ def is_configured(self) -> bool:

def configure(self):
config = OpenKlantConfig.get_solo()
config.klanten_service = Service.objects.get(api_root=settings.KLANTEN_API_ROOT)
config.klanten_service = Service.objects.get(
api_root=settings.KIC_CONFIG_KLANTEN_API_ROOT
)
config.contactmomenten_service = Service.objects.get(
api_root=settings.CONTACTMOMENTEN_API_ROOT
api_root=settings.KIC_CONFIG_CONTACTMOMENTEN_API_ROOT
)

if settings.KIC_REGISTER_EMAIL:
config.register_email = settings.KIC_REGISTER_EMAIL
if settings.KIC_REGISTER_CONTACT_MOMENT is not None:
config.register_contact_moment = settings.KIC_REGISTER_CONTACT_MOMENT
if settings.KIC_REGISTER_BRONORGANISATIE_RSIN:
if settings.KIC_CONFIG_REGISTER_EMAIL:
config.register_email = settings.KIC_CONFIG_REGISTER_EMAIL
if settings.KIC_CONFIG_REGISTER_CONTACT_MOMENT is not None:
config.register_contact_moment = settings.KIC_CONFIG_REGISTER_CONTACT_MOMENT
if settings.KIC_CONFIG_REGISTER_BRONORGANISATIE_RSIN:
config.register_bronorganisatie_rsin = (
settings.KIC_REGISTER_BRONORGANISATIE_RSIN
settings.KIC_CONFIG_REGISTER_BRONORGANISATIE_RSIN
)
if settings.KIC_REGISTER_CHANNEL:
config.register_channel = settings.KIC_REGISTER_CHANNEL
if settings.KIC_REGISTER_TYPE:
config.register_type = settings.KIC_REGISTER_TYPE
if settings.KIC_REGISTER_EMPLOYEE_ID:
config.register_employee_id = settings.KIC_REGISTER_EMPLOYEE_ID
if settings.KIC_USE_RSIN_FOR_INNNNPID_QUERY_PARAMETER is not None:
if settings.KIC_CONFIG_REGISTER_CHANNEL:
config.register_channel = settings.KIC_CONFIG_REGISTER_CHANNEL
if settings.KIC_CONFIG_REGISTER_TYPE:
config.register_type = settings.KIC_CONFIG_REGISTER_TYPE
if settings.KIC_CONFIG_REGISTER_EMPLOYEE_ID:
config.register_employee_id = settings.KIC_CONFIG_REGISTER_EMPLOYEE_ID
if settings.KIC_CONFIG_USE_RSIN_FOR_INNNNPID_QUERY_PARAMETER is not None:
config.use_rsin_for_innNnpId_query_parameter = (
settings.KIC_USE_RSIN_FOR_INNNNPID_QUERY_PARAMETER
settings.KIC_CONFIG_USE_RSIN_FOR_INNNNPID_QUERY_PARAMETER
)

config.save()
Expand All @@ -153,7 +144,7 @@ def test_configuration(self):
make requests to the APIs and verify that a connection can be made
"""
klanten_client = build_client("klanten")
contactmomenten_client = build_client("contactmomenten")
contactmoment_client = build_client("contactmomenten")

try:
response = klanten_client.get(
Expand All @@ -166,7 +157,7 @@ def test_configuration(self):
) from exc

try:
response = contactmomenten_client.get(
response = contactmoment_client.get(
"contactmomenten", params={"identificatie": "00000"}
)
response.raise_for_status()
Expand Down
Loading

0 comments on commit 93b3be8

Please sign in to comment.