summaryrefslogtreecommitdiffstats
path: root/users
diff options
context:
space:
mode:
authorAndrew Godwin2022-11-11 23:04:43 -0700
committerAndrew Godwin2022-11-11 23:04:43 -0700
commit8fd5a9292c7d3aac352d3c0e96288bff8a79cb47 (patch)
tree3a9199c1d35a77d209cf424141fd4aa0e0694118 /users
parentfeb5d9b74fa1e8454eaaf29afae3643c6d7c81f1 (diff)
downloadtakahe-8fd5a9292c7d3aac352d3c0e96288bff8a79cb47.tar.gz
takahe-8fd5a9292c7d3aac352d3c0e96288bff8a79cb47.tar.bz2
takahe-8fd5a9292c7d3aac352d3c0e96288bff8a79cb47.zip
Posting and fan-out both working
Diffstat (limited to 'users')
-rw-r--r--users/migrations/0001_initial.py10
-rw-r--r--users/views/identity.py8
2 files changed, 11 insertions, 7 deletions
diff --git a/users/migrations/0001_initial.py b/users/migrations/0001_initial.py
index c4f4774..a51ef00 100644
--- a/users/migrations/0001_initial.py
+++ b/users/migrations/0001_initial.py
@@ -92,7 +92,7 @@ class Migration(migrations.Migration):
verbose_name="ID",
),
),
- ("state_ready", models.BooleanField(default=False)),
+ ("state_ready", models.BooleanField(default=True)),
("state_changed", models.DateTimeField(auto_now_add=True)),
("state_attempted", models.DateTimeField(blank=True, null=True)),
("state_locked_until", models.DateTimeField(blank=True, null=True)),
@@ -158,7 +158,7 @@ class Migration(migrations.Migration):
verbose_name="ID",
),
),
- ("state_ready", models.BooleanField(default=False)),
+ ("state_ready", models.BooleanField(default=True)),
("state_changed", models.DateTimeField(auto_now_add=True)),
("state_attempted", models.DateTimeField(blank=True, null=True)),
("state_locked_until", models.DateTimeField(blank=True, null=True)),
@@ -230,7 +230,9 @@ class Migration(migrations.Migration):
(
"users",
models.ManyToManyField(
- related_name="identities", to=settings.AUTH_USER_MODEL
+ blank=True,
+ related_name="identities",
+ to=settings.AUTH_USER_MODEL,
),
),
],
@@ -286,7 +288,7 @@ class Migration(migrations.Migration):
verbose_name="ID",
),
),
- ("state_ready", models.BooleanField(default=False)),
+ ("state_ready", models.BooleanField(default=True)),
("state_changed", models.DateTimeField(auto_now_add=True)),
("state_attempted", models.DateTimeField(blank=True, null=True)),
("state_locked_until", models.DateTimeField(blank=True, null=True)),
diff --git a/users/views/identity.py b/users/views/identity.py
index 6205145..3bcf5c5 100644
--- a/users/views/identity.py
+++ b/users/views/identity.py
@@ -36,12 +36,12 @@ class ViewIdentity(TemplateView):
local=False,
fetch=True,
)
- statuses = identity.statuses.all()[:100]
+ posts = identity.posts.all()[:100]
if identity.data_age > settings.IDENTITY_MAX_AGE:
identity.transition_perform(IdentityStates.outdated)
return {
"identity": identity,
- "statuses": statuses,
+ "posts": posts,
"follow": Follow.maybe_get(self.request.identity, identity)
if self.request.identity
else None,
@@ -232,9 +232,11 @@ class Inbox(View):
if not identity.verify_signature(
signature_details["signature"], headers_string
):
+ print("Bad signature!")
+ print(document)
return HttpResponseUnauthorized("Bad signature")
# Hand off the item to be processed by the queue
- InboxMessage.objects.create(message=document, state_ready=True)
+ InboxMessage.objects.create(message=document)
return HttpResponse(status=202)