Skip to content

Commit

Permalink
Merge pull request openwallet-foundation#3470 from dbluhm/fix/unique-…
Browse files Browse the repository at this point in the history
…profile-name

fix: ensure profile names are unique
  • Loading branch information
dbluhm authored Jan 27, 2025
2 parents f30c77a + 3f80a4d commit ef1ab19
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions acapy_agent/askar/profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
6 changes: 4 additions & 2 deletions acapy_agent/askar/profile_anon.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down

0 comments on commit ef1ab19

Please sign in to comment.