projects
/
sommitrealweird.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Enable CSRF and Comment Moderation
[sommitrealweird.git]
/
sommitrealweird
/
blog
/
models.py
diff --git
a/sommitrealweird/blog/models.py
b/sommitrealweird/blog/models.py
index 16347546e110e58a1f93fec0b4a5db79b9da82be..c98407ded0d508709e9b7c58b1716ea072e4e706 100644
(file)
--- a/
sommitrealweird/blog/models.py
+++ b/
sommitrealweird/blog/models.py
@@
-1,3
+1,4
@@
+from django.contrib.comments.moderation import CommentModerator, moderator
from django.db import models
from django.conf import settings
from django.contrib import admin
from django.db import models
from django.conf import settings
from django.contrib import admin
@@
-28,6
+29,14
@@
class BlogEntry(models.Model):
class Meta:
ordering = ['-publish_date']
class Meta:
ordering = ['-publish_date']
+class BlogEntryCommentModerator(CommentModerator):
+ email_notification = True
+
+ def moderate(self, comment, content_object, request):
+ return True
+
+moderator.register(BlogEntry, BlogEntryCommentModerator)
+
class BlogSection(models.Model):
title = models.CharField(max_length=150)
slug = models.SlugField()
class BlogSection(models.Model):
title = models.CharField(max_length=150)
slug = models.SlugField()