diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8c1d55d531..9576a20b7d 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -15,6 +15,10 @@ Change Log Unreleased ---------- +[4.6.6] +------- +chore: orchestrator exception handling and submission refinements + [4.6.5] ------- feat: Added logs for Degreed2 client diff --git a/enterprise/__init__.py b/enterprise/__init__.py index 1f15cde935..4a7b6943fd 100644 --- a/enterprise/__init__.py +++ b/enterprise/__init__.py @@ -2,4 +2,4 @@ Your project description goes here. """ -__version__ = "4.6.5" +__version__ = "4.6.6" diff --git a/enterprise/api/v1/views/enterprise_customer_sso_configuration.py b/enterprise/api/v1/views/enterprise_customer_sso_configuration.py index a93156a57c..252f7aed1f 100644 --- a/enterprise/api/v1/views/enterprise_customer_sso_configuration.py +++ b/enterprise/api/v1/views/enterprise_customer_sso_configuration.py @@ -322,7 +322,7 @@ def update(self, request, *args, **kwargs): with transaction.atomic(): sso_configuration_record.update(**request_data) sso_configuration_record.first().submit_for_configuration(updating_existing_record=True) - except (TypeError, FieldDoesNotExist, ValidationError) as e: + except (TypeError, FieldDoesNotExist, ValidationError, SsoOrchestratorClientError) as e: LOGGER.error(f'{CONFIG_UPDATE_ERROR}{e}') return Response({'error': f'{CONFIG_UPDATE_ERROR}{e}'}, status=HTTP_400_BAD_REQUEST) serializer = self.serializer_class(sso_configuration_record.first()) diff --git a/enterprise/models.py b/enterprise/models.py index c883dac36a..4cd6fba832 100644 --- a/enterprise/models.py +++ b/enterprise/models.py @@ -4082,7 +4082,8 @@ def submit_for_configuration(self, updating_existing_record=False): config_data = {} if self.identity_provider == self.SAP_SUCCESS_FACTORS: for field in self.sap_config_fields: - sap_data[utils.camelCase(field)] = getattr(self, field) + if field_value := getattr(self, field): + sap_data[utils.camelCase(field)] = field_value is_sap = True else: for field in self.base_saml_config_fields: @@ -4091,8 +4092,8 @@ def submit_for_configuration(self, updating_existing_record=False): config_data['enable'] = True else: config_data['enable'] = getattr(self, field) - else: - config_data[utils.camelCase(field)] = getattr(self, field) + elif field_value := getattr(self, field): + config_data[utils.camelCase(field)] = field_value EnterpriseSSOOrchestratorApiClient().configure_sso_orchestration_record( config_data=config_data,