def post(self, request, *args, **kwargs):
        """ Validates subscription data before creating Outbound message
        """
        # Look up subscriber
        subscription_id = kwargs["subscription_id"]
        if Subscription.objects.filter(id=subscription_id).exists():
            status = 202
            accepted = {"accepted": True}
            store_resend_request.apply_async(args=[subscription_id])
        else:
            status = 400
            accepted = {
                "accepted": False,
                "reason": "Cannot find subscription with ID {}".format(subscription_id),
            }
        return Response(accepted, status=status)
def post ( self , request , * args , ** kwargs ) : subscription_id = kwargs [ "subscription_id" ] if Subscription . objects . filter ( id = subscription_id ) . exists ( ) : status = 202 accepted = { "accepted" : True } store_resend_request . apply_async ( args = [ subscription_id ] ) else : status = 400 accepted = { "accepted" : False , "reason" : "Cannot find subscription with ID {}" . format ( subscription_id ) , } return Response ( accepted , status = status )
Validates subscription data before creating Outbound message