WebSub-ping the kind-specific entry URLs as well, not just the generic ones

This commit is contained in:
Danielle McLean 2017-11-09 10:14:50 +11:00
parent 6b51531cb4
commit e4e8beb958
Signed by untrusted user: 00dani
GPG key ID: 5A5D2D1AFF12EEC5

View file

@ -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)