creating signal to award badge

asked 2014-03-18 11:47:30 -0500

SocialQA gravatar image

I have a new simple badge something like badge for first 10 karma points. I have put together the badge by following the existing method. But now the problem is awarding the badge. I am not sure how I should create the signal.

What I did was following: I add the following to user_moderate_user_reputation

if reputation_change != 0:
    award_badges_signal.send(None,
        event = 'reach_10_karma',
        actor = user,
        context_object = user,
        timestamp = timestamp
    )

I thought the signal needs to be called every time the reputation changes to check the award. But this was not successful. What is the best way to implement this?

edit retag flag offensive close merge delete