summaryrefslogtreecommitdiffstats
path: root/users/views
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-07 00:19:00 -0700
committerAndrew Godwin2022-11-07 00:19:00 -0700
commitc391e7bc4151ae148d42acd8bbe303338cdde31c (patch)
treed2b79043a63b52ec4692469eab596d831d396b9a /users/views
parentfb6c409a9af5b8a686e977ee2251c359071e0ec3 (diff)
downloadtakahe-c391e7bc4151ae148d42acd8bbe303338cdde31c.tar.gz
takahe-c391e7bc4151ae148d42acd8bbe303338cdde31c.tar.bz2
takahe-c391e7bc4151ae148d42acd8bbe303338cdde31c.zip
THE FOLLOWS, THEY WORK
Well, in one direction anyway
Diffstat (limited to 'users/views')
-rw-r--r--users/views/identity.py13
1 files changed, 7 insertions, 6 deletions
diff --git a/users/views/identity.py b/users/views/identity.py
index 7cba43e..98fcdd6 100644
--- a/users/views/identity.py
+++ b/users/views/identity.py
@@ -130,8 +130,9 @@ class CreateIdentity(FormView):
def form_valid(self, form):
username = form.cleaned_data["username"]
domain = form.cleaned_data["domain"]
+ domain_instance = Domain.get_local_domain(domain)
new_identity = Identity.objects.create(
- actor_uri=f"https://{domain}/@{username}/actor/",
+ actor_uri=f"https://{domain_instance.uri_domain}/@{username}@{domain}/actor/",
username=username,
domain_id=domain,
name=form.cleaned_data["name"],
@@ -154,13 +155,13 @@ class Actor(View):
"https://www.w3.org/ns/activitystreams",
"https://w3id.org/security/v1",
],
- "id": identity.urls.actor.full(),
+ "id": identity.actor_uri,
"type": "Person",
- "inbox": identity.urls.inbox.full(),
+ "inbox": identity.actor_uri + "inbox/",
"preferredUsername": identity.username,
"publicKey": {
- "id": identity.urls.key.full(),
- "owner": identity.urls.actor.full(),
+ "id": identity.key_id,
+ "owner": identity.actor_uri,
"publicKeyPem": identity.public_key,
},
"published": identity.created.strftime("%Y-%m-%dT%H:%M:%SZ"),
@@ -249,7 +250,7 @@ class Webfinger(View):
{
"rel": "self",
"type": "application/activity+json",
- "href": identity.urls.actor.full(),
+ "href": identity.actor_uri,
},
],
}