Пример #1
0
def cancel_request(request):
	if request.method == 'POST':
		request_id = request.POST['request_id']
		if delete_item(request_id):
			return ok_resp
		return bad_resp
	return HttpResponseNotAllowed(['POST'])
Пример #2
0
def cancel_request(request):
    if request.method == 'POST':
        request_id = request.POST['request_id']
        if delete_item(request_id):
            return ok_resp
        return bad_resp
    return HttpResponseNotAllowed(['POST'])
Пример #3
0
def fulfill_request(request):
	if request.method == 'POST':
		request_id = request.POST['request_id']
		if not delete_item(request_id):
			return bad_resp
		return_url = YELP_LOVE_URL
		if 'delivery_person' in request.POST:
			delivery_person = request.POST['delivery_person']
			return_url += '?recipient=%s' % delivery_person
		return HttpResponse(json.dumps({'url': return_url}))
	return HttpResponseNotAllowed(['POST'])
Пример #4
0
def fulfill_request(request):
    if request.method == 'POST':
        request_id = request.POST['request_id']
        if not delete_item(request_id):
            return bad_resp
        return_url = YELP_LOVE_URL
        if 'delivery_person' in request.POST:
            delivery_person = request.POST['delivery_person']
            return_url += '?recipient=%s' % delivery_person
        return HttpResponse(json.dumps({'url': return_url}))
    return HttpResponseNotAllowed(['POST'])