Whoops, fix up the WebSub ping implementation - it should actually work now

This commit is contained in:
Danielle McLean 2017-11-06 21:05:00 +11:00
parent 5c643299c7
commit 3cc2fe798f
Signed by: 00dani
GPG key ID: 5A5D2D1AFF12EEC5

View file

@ -1,12 +1,9 @@
import requests
from django.conf import settings
from django_rq import job
from urllib.parse import urlencode
@job
def ping_hub(*urls):
requests.post(settings.PUSH_HUB, data={
'hub.mode': 'publish',
'hub.url': ','.join(map(urlencode, urls)),
})
data = [('hub.mode', 'publish')] + [('hub.url[]', url) for url in urls]
requests.post(settings.PUSH_HUB, data=data)