diff --git a/acapy_agent/askar/profile.py b/acapy_agent/askar/profile.py index 2b5c8bfe62..e562ff88ff 100644 --- a/acapy_agent/askar/profile.py +++ b/acapy_agent/askar/profile.py @@ -42,7 +42,9 @@ def __init__( profile_id: Optional[str] = None, ): """Create a new AskarProfile instance.""" - super().__init__(context=context, name=opened.name, created=opened.created) + super().__init__( + context=context, name=profile_id or opened.name, created=opened.created + ) self.opened = opened self.ledger_pool: Optional[IndyVdrLedgerPool] = None self.profile_id = profile_id @@ -52,7 +54,7 @@ def __init__( @property def name(self) -> str: """Accessor for the profile name.""" - return self.opened.name + return self.profile_id or self.opened.name @property def store(self) -> Store: diff --git a/acapy_agent/askar/profile_anon.py b/acapy_agent/askar/profile_anon.py index 9a3cb3e622..90c6e7a09d 100644 --- a/acapy_agent/askar/profile_anon.py +++ b/acapy_agent/askar/profile_anon.py @@ -44,7 +44,9 @@ def __init__( profile_id: Optional[str] = None, ): """Create a new AskarProfile instance.""" - super().__init__(context=context, name=opened.name, created=opened.created) + super().__init__( + context=context, name=profile_id or opened.name, created=opened.created + ) self.opened = opened self.ledger_pool: Optional[IndyVdrLedgerPool] = None self.profile_id = profile_id @@ -54,7 +56,7 @@ def __init__( @property def name(self) -> str: """Accessor for the profile name.""" - return self.opened.name + return self.profile_id or self.opened.name @property def store(self) -> Store: