ensure key pair generation
This commit is contained in:
parent
147e345976
commit
39bc7497f0
1 changed files with 2 additions and 0 deletions
|
@ -79,6 +79,7 @@ class Takahe:
|
|||
user.email = handler
|
||||
user.save()
|
||||
domain = Domain.objects.get(domain=settings.SITE_INFO["site_domain"])
|
||||
# TODO add transaction protection here
|
||||
identity = Identity.objects.filter(username=u.username, local=True).first()
|
||||
if not identity:
|
||||
logger.info(f"Creating takahe identity {u}@{domain}")
|
||||
|
@ -91,6 +92,7 @@ class Takahe:
|
|||
local=True,
|
||||
discoverable=True,
|
||||
)
|
||||
if not identity.private_key and not identity.public_key:
|
||||
identity.generate_keypair()
|
||||
identity.ensure_uris()
|
||||
if not user.identities.filter(pk=identity.pk).exists():
|
||||
|
|
Loading…
Add table
Reference in a new issue