From e4e8beb95897cbd9ee92df5769cccda79e01886c Mon Sep 17 00:00:00 2001 From: Danielle McLean Date: Thu, 9 Nov 2017 10:14:50 +1100 Subject: [PATCH] WebSub-ping the kind-specific entry URLs as well, not just the generic ones --- micropub/views.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/micropub/views.py b/micropub/views.py index 3c21209..743a22b 100644 --- a/micropub/views.py +++ b/micropub/views.py @@ -27,13 +27,15 @@ def micropub(request): post = request.POST if post.get('h') != 'entry': return utils.bad_req('only h=entry supported') - entry = Entry(author=user, kind=Note.id) + entry = Entry(author=user) + kind = Note if 'name' in post: entry.name = post['name'] - entry.kind = Article.id + kind = Article if 'content' in post: entry.content = post['content'] + entry.kind = kind.id entry.save() base = utils.origin(request) @@ -42,6 +44,9 @@ def micropub(request): reverse('home:index'), reverse('entries:atom'), reverse('entries:rss'), + reverse('entries:' + kind.index), + reverse('entries:' + kind.atom), + reverse('entries:' + kind.rss), )) ping_hub.delay(perma, *others) send_mentions.delay(perma)