开发者

Function called three times when in facebook?

I'm using the following code to add one to two values in case the user wins a challege.

def challengewin(request):
    uid = 1313693
    tempuser = User.objects.get(id=uid)
    tempuser.challengeswon = tempuser.challengeswon + 1
    tempuser.silver = tempuser.silver + 1
    tempuser.save()
    return HttpResponse()

this works fine if I am working outside the facebook canvas page, inside the canvas page 3 is added instead of开发者_高级运维 1 everytime. Any Ideas?


I would guess that the code you have included is not the culprit.

Have you confirmed that challengewin(request); is not being called 3 times?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜