views:

42

answers:

1

Hi,

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?

A: 

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?

Matt
Under normal circumstances its called just once, but when I put it in facebook canvas page ( even in url) and press enter its called three times.
Fahim Akhter