creating signal to award badge
 

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?

To enter a block of code:

  • enter empty line after your previous text
  • paste or type the code
  • select the code and press the button above
Preview: (hide)
SocialQA's avatar
265
SocialQA
asked 11 years ago

Comments

see more comments