From 22bca789bc1a1230611a4328584c69d6ffd47028 Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Fri, 23 Feb 2024 10:57:47 +0100 Subject: [PATCH] confirm than your organization is created --- idhub/management/commands/initial_datas.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/idhub/management/commands/initial_datas.py b/idhub/management/commands/initial_datas.py index 8205918..363d7fb 100644 --- a/idhub/management/commands/initial_datas.py +++ b/idhub/management/commands/initial_datas.py @@ -7,9 +7,8 @@ from utils import credtools from django.conf import settings from django.core.management.base import BaseCommand from django.contrib.auth import get_user_model -from django.core.cache import cache from decouple import config -from idhub.models import DID, Schemas +from idhub.models import Schemas from oidc4vp.models import Organization @@ -36,6 +35,9 @@ class Command(BaseCommand): for r in f: self.create_organizations(r[0].strip(), r[1].strip()) + # You need to confirm than your Organization is created + assert Organization.objects.filter(name=settings.ORGANIZATION).exists() + if settings.SYNC_ORG_DEV == 'y': self.sync_credentials_organizations("pangea.org", "somconnexio.coop") self.sync_credentials_organizations("local 8000", "local 9000")