(self, request)
return HttpResponse(status=200)
Callback to notify about a feed update
Callback to notify about a feed update
Callback to notify about a feed update
def post(self, request):
        """Callback to notify about a feed update"""

        feed_url = request.GET.get("url")

        if not feed_url:
            logger.info("received notification without url")
            return HttpResponse(status=400)

        logger.info("received notification for %s" % feed_url)

        try:
            subscription = HubSubscription.objects.get(topic_url=feed_url)

        except HubSubscription.DoesNotExist:
            logger.warning("no subscription for this URL")
            return HttpResponse(status=400)

        if subscription.mode != "subscribe":
            logger.warning("invalid subscription mode: %s" % subscription.mode)
            return HttpResponse(status=400)

        if not subscription.verified:
            logger.warning("the subscription has not yet been verified")
            return HttpResponse(status=400)

        subscription_updated.send(sender=feed_url)

        return HttpResponse(status=200)
def post ( self , request ) : feed_url = request . GET . get ( "url" ) if not feed_url : logger . info ( "received notification without url" ) return HttpResponse ( status = 400 ) logger . info ( "received notification for %s" % feed_url ) try : subscription = HubSubscription . objects . get ( topic_url = feed_url ) except HubSubscription . DoesNotExist : logger . warning ( "no subscription for this URL" ) return HttpResponse ( status = 400 ) if subscription . mode != "subscribe" : logger . warning ( "invalid subscription mode: %s" % subscription . mode ) return HttpResponse ( status = 400 ) if not subscription . verified : logger . warning ( "the subscription has not yet been verified" ) return HttpResponse ( status = 400 ) subscription_updated . send ( sender = feed_url ) return HttpResponse ( status = 200 )