request.raw_post_data -> request.body (django 1.6)

This commit is contained in:
Samuel Clay 2020-12-03 11:58:54 -05:00
parent 57bc4c2569
commit 67ef0c578f
2 changed files with 3 additions and 3 deletions

View file

@ -52,11 +52,11 @@ def push_callback(request, push_id):
# XXX TODO: Optimize this by removing feedparser. It just needs to find out
# the hub_url or topic has changed. ElementTree could do it.
if random.random() < 0.1:
parsed = feedparser.parse(request.raw_post_data)
parsed = feedparser.parse(request.body)
subscription.check_urls_against_pushed_data(parsed)
# Don't give fat ping, just fetch.
# subscription.feed.queue_pushed_feed_xml(request.raw_post_data)
# subscription.feed.queue_pushed_feed_xml(request.body)
if subscription.feed.active_premium_subscribers >= 1:
subscription.feed.queue_pushed_feed_xml("Fetch me", latest_push_date_delta=latest_push_date_delta)
MFetchHistory.add(feed_id=subscription.feed_id,

View file

@ -64,7 +64,7 @@ def webhooks_v2(request):
if request.method != "POST":
return HttpResponse("Invalid Request.", status=400)
event_json = json.loads(request.raw_post_data)
event_json = json.loads(request.body)
event_key = event_json['type'].replace('.', '_')
if event_key in WEBHOOK_MAP: