Ticket #3473: comments.diff
File comments.diff, 667 bytes (added by , 18 years ago) |
---|
-
contrib/comments/models.py
209 209 class KarmaScoreManager(models.Manager): 210 210 def vote(self, user_id, comment_id, score): 211 211 try: 212 karma = self. objects.get(comment__pk=comment_id, user__pk=user_id)212 karma = self.get(comment__pk=comment_id, user__pk=user_id) 213 213 except self.model.DoesNotExist: 214 214 karma = self.model(None, user_id=user_id, comment_id=comment_id, score=score, scored_date=datetime.datetime.now()) 215 215 karma.save()