from django.contrib.comments.moderation import CommentModerator, moderator
from comments_moderation import settings
from models import EmailFilter

class FilteredCommentsModerator(CommentModerator):
    def moderate(self, comment, content_object, request):
        if settings.MODERATION_MODE == 'approve':
            moderate_states = ('moderate',)
        else:
            moderate_states = ('moderate', 'new')
        if EmailFilter.objects.filter(email = comment.user_email, active__in = moderate_states).count() > 0:
            return True
        email_filter = EmailFilter(email = comment.user_email)
        email_filter.save()
        return settings.MODERATION_MODE == 'approve'

def register(model):
    moderator.register(model, FilteredCommentsModerator)

@@ -8,17 +8,9 @@
 ango
-.contrib.
+_
 comm

update to Django 1.9