def respondchannel(request, pk1, pk2, num): context = {} if request.user.is_authenticated(): print 'response' print request.GET.get('response') new_response = Response() print num if int(num) == 1: new_response.is_resp_to_reply = False else: new_response.is_resp_to_reply = True print 'New resp' + str(new_response.is_resp_to_reply) new_response.text = request.GET.get('response') new_response.channel = Channel.objects.get(pk=pk1) new_response.original_comment = Comment.objects.get(pk=pk2) new_response.user = request.user new_response.save() return HttpResponseRedirect('/channel_detail/%s' % pk1) else: print 'anonymous user' return HttpResponseRedirect('/please_login/') return render_to_response('channel_detail.html', context, context_instance=RequestContext(request))
def respondchannel(request, pk1, pk2, num): context = {} if request.user.is_authenticated(): print 'response' print request.GET.get('response') new_response = Response() print num if int(num) == 1: new_response.is_resp_to_reply = False else: new_response.is_resp_to_reply = True print 'New resp' + str(new_response.is_resp_to_reply) new_response.text = request.GET.get('response') new_response.channel = Channel.objects.get(pk=pk1) new_response.original_comment = Comment.objects.get(pk=pk2) new_response.user = request.user new_response.save() return HttpResponseRedirect('/channel_detail/%s' %pk1) else: print 'anonymous user' return HttpResponseRedirect('/please_login/') return render_to_response('channel_detail.html', context, context_instance=RequestContext(request))