Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overriding default Zinnia moderation workflow.
- Loading branch information
1 parent
1b7d8b6
commit d0f3ec7
Showing
4 changed files
with
51 additions
and
1 deletion.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# This file can be located in the root directory of your project. | ||
# You should import this module at the loading of the project. | ||
# Exemple, in the urls.py module of your project. | ||
# | ||
# import myproject.project_moderation | ||
|
||
from django.conf import settings | ||
from django.utils.translation import activate | ||
from django.utils.translation import get_language | ||
from django.contrib.comments.moderation import moderator | ||
|
||
from zinnia.models import Entry | ||
from zinnia.moderator import EntryCommentModerator | ||
|
||
class ProjectEntryCommentModerator(EntryCommentModerator): | ||
|
||
def email(self, comment, content_object, request): | ||
"""Always send mail on new comments""" | ||
current_language = get_language() | ||
try: | ||
activate(settings.LANGUAGE_CODE) | ||
if self.mail_comment_notification_recipients: | ||
self.do_email_notification(comment, content_object, | ||
request) | ||
if self.email_authors: | ||
self.do_email_authors(comment, content_object, | ||
request) | ||
if self.email_reply: | ||
self.do_email_reply(comment, content_object, request) | ||
finally: | ||
activate(current_language) | ||
|
||
|
||
|
||
moderator.unregister(Entry) | ||
moderator.register(Entry, ProjectEntryCommentModerator) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -179,6 +179,9 @@ | |
'sorl.thumbnail', | ||
'imagestore.imagestore_cms', | ||
|
||
#testing cms_js | ||
'cms_jsapp', | ||
|
||
|
||
|
||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters