From f39061206fca3bf144e7761d4a96e5e46f19984c Mon Sep 17 00:00:00 2001 From: Cayo Puigdefabregas Date: Thu, 30 Jan 2025 13:19:32 +0100 Subject: [PATCH] accept gdpr for admin --- idhub/management/commands/open_service.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/idhub/management/commands/open_service.py b/idhub/management/commands/open_service.py index 91c08f7..95ec093 100644 --- a/idhub/management/commands/open_service.py +++ b/idhub/management/commands/open_service.py @@ -6,6 +6,7 @@ from django.core.management import call_command from django.core.cache import cache from idhub.models import DID +from idhub_auth.models import User logger = logging.getLogger(__name__) @@ -23,6 +24,10 @@ class Command(BaseCommand): self.ip_port = kwargs["ip_port"] cache.set("KEY_DIDS", self._key, None) + admin = User.objects.filter(is_admin=True).first() + admin.accept_gdpr = True + admin.save() + if not DID.objects.exists(): cache.set("KEY_DIDS", self._key, None) call_command('runserver', self.ip_port) @@ -30,6 +35,7 @@ class Command(BaseCommand): did = DID.objects.first() cache.set("KEY_DIDS", self._key, None) + try: did.get_key_material() except CryptoError: