+from django.contrib.comments.moderation import CommentModerator, moderator
from django.db import models
from django.conf import settings
from django.contrib import admin
class Meta:
ordering = ['-publish_date']
+class BlogEntryCommentModerator(CommentModerator):
+ email_notification = True
+
+ def moderate(self, comment, content_object, request):
+ if request.user.is_authenticated():
+ return False
+ else:
+ return True
+
+moderator.register(BlogEntry, BlogEntryCommentModerator)
+
class BlogSection(models.Model):
title = models.CharField(max_length=150)
slug = models.SlugField()