diff options
author | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-11-08 15:27:43 -0500 |
---|---|---|
committer | Evgeny Fadeev <evgeny.fadeev@gmail.com> | 2010-11-08 15:27:43 -0500 |
commit | e30fb53b1db25813087a1acf39cbc353a07c4011 (patch) | |
tree | 22e280306b3f6795032cf1eeba9da1770cc1b7da /askbot/auth.py | |
parent | fa5104ed0d0a181f791c8c5d24b144fa6615ea51 (diff) | |
download | askbot-e30fb53b1db25813087a1acf39cbc353a07c4011.tar.gz askbot-e30fb53b1db25813087a1acf39cbc353a07c4011.tar.bz2 askbot-e30fb53b1db25813087a1acf39cbc353a07c4011.zip |
removed the FlaggedItem model completely
Diffstat (limited to 'askbot/auth.py')
-rw-r--r-- | askbot/auth.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/askbot/auth.py b/askbot/auth.py index 4a1602e5..05403634 100644 --- a/askbot/auth.py +++ b/askbot/auth.py @@ -42,11 +42,10 @@ def calculate_reputation(origin, offset): return 1 @transaction.commit_on_success -def onFlaggedItem(item, post, user, timestamp=None): +def onFlaggedItem(post, user, timestamp=None): if timestamp is None: timestamp = datetime.datetime.now() - item.save() post.offensive_flag_count = post.offensive_flag_count + 1 post.save() @@ -56,15 +55,14 @@ def onFlaggedItem(item, post, user, timestamp=None): ) post.author.save() - question = post - if isinstance(post, Answer): - question = post.question + question = post.get_origin_post() reputation = Repute( user=post.author, negative=askbot_settings.REP_LOSS_FOR_RECEIVING_FLAG, - question=question, reputed_at=timestamp, - reputation_type=-4, + question=question, + reputed_at=timestamp, + reputation_type=-4,#todo: clean up magic number reputation=post.author.reputation ) reputation.save() |