From c6db2578dead5d3d61ae444c1715fc22c3b973e5 Mon Sep 17 00:00:00 2001 From: Luke Plant Date: Wed, 1 Feb 2006 18:47:12 +0000 Subject: [PATCH] magic-removal: Updated Manager in comments model to use .model instead of .klass git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2216 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/contrib/comments/models.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/django/contrib/comments/models.py b/django/contrib/comments/models.py index 98c5f239a7..a9e1fb6196 100644 --- a/django/contrib/comments/models.py +++ b/django/contrib/comments/models.py @@ -209,8 +209,8 @@ class KarmaScoreManager(models.Manager): def vote(self, user_id, comment_id, score): try: karma = self.get_object(comment__id__exact=comment_id, user__id__exact=user_id) - except self.klass.DoesNotExist: - karma = self.klass(None, user_id, comment_id, score, datetime.datetime.now()) + except self.model.DoesNotExist: + karma = self.model(None, user_id, comment_id, score, datetime.datetime.now()) karma.save() else: karma.score = score @@ -251,9 +251,9 @@ class UserFlagManager(models.Manager): return # A user can't flag his own comment. Fail silently. try: f = self.get_object(user__id__exact=user.id, comment__id__exact=comment.id) - except self.klass.DoesNotExist: + except self.model.DoesNotExist: from django.core.mail import mail_managers - f = self.klass(None, user.id, comment.id, None) + f = self.model(None, user.id, comment.id, None) message = _('This comment was flagged by %(user)s:\n\n%(text)s') % {'user': user.username, 'text': comment.get_as_text()} mail_managers('Comment flagged', message, fail_silently=True) f.save()