From 31427796a0d1ebe65459dae9f63b8e06ef77bbc1 Mon Sep 17 00:00:00 2001 From: Tim DiLauro Date: Tue, 27 Feb 2024 10:36:36 -0500 Subject: [PATCH 1/2] Fix circular import issue. --- bin/configuration/add_saml_federations.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/bin/configuration/add_saml_federations.py b/bin/configuration/add_saml_federations.py index 71ba92f1f5..d7dd10d439 100755 --- a/bin/configuration/add_saml_federations.py +++ b/bin/configuration/add_saml_federations.py @@ -10,8 +10,7 @@ sys.path.append(os.path.abspath(package_dir)) from api.saml.metadata.federations import incommon -from api.saml.metadata.federations.model import SAMLFederation -from core.model import production_session +from core.model import SAMLFederation, production_session with closing(production_session()) as db: incommon_federation = ( From 7f13e206d1347bf535293e07d4fd5f55da0c8e8c Mon Sep 17 00:00:00 2001 From: Tim DiLauro Date: Tue, 27 Feb 2024 12:18:45 -0500 Subject: [PATCH 2/2] Fix some circular imports in library modules. --- api/saml/metadata/federations/loader.py | 5 +---- api/saml/metadata/federations/validator.py | 2 +- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/api/saml/metadata/federations/loader.py b/api/saml/metadata/federations/loader.py index 3e4e21a359..c30c96a3ab 100644 --- a/api/saml/metadata/federations/loader.py +++ b/api/saml/metadata/federations/loader.py @@ -3,13 +3,10 @@ from onelogin.saml2.idp_metadata_parser import OneLogin_Saml2_IdPMetadataParser from onelogin.saml2.xmlparser import tostring -from api.saml.metadata.federations.model import ( - SAMLFederatedIdentityProvider, - SAMLFederation, -) from api.saml.metadata.federations.validator import SAMLFederatedMetadataValidator from api.saml.metadata.parser import SAMLMetadataParser from core.exceptions import BasePalaceException +from core.model import SAMLFederatedIdentityProvider, SAMLFederation from core.util import first_or_default diff --git a/api/saml/metadata/federations/validator.py b/api/saml/metadata/federations/validator.py index 1679f21ca2..4de11976ed 100644 --- a/api/saml/metadata/federations/validator.py +++ b/api/saml/metadata/federations/validator.py @@ -5,8 +5,8 @@ from onelogin.saml2.utils import OneLogin_Saml2_Utils from onelogin.saml2.xmlparser import fromstring -from api.saml.metadata.federations.model import SAMLFederation from core.exceptions import BasePalaceException +from core.model import SAMLFederation from core.util.datetime_helpers import from_timestamp, utc_now