开发者

Function called three times when in facebook?

开发者 https://www.devze.com 2022-12-17 06:15 出处:网络
I\'m using the following code to add one to two values in case the user wins a challege. def challengewin(request):

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

精彩评论

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