Skip to content

Commit

Permalink
Overriding default Zinnia moderation workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
bianchimro committed Mar 22, 2012
1 parent 1b7d8b6 commit d0f3ec7
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 1 deletion.
Empty file.
36 changes: 36 additions & 0 deletions bianchimro/overrides/zinnia_moderation.py
@@ -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)
3 changes: 3 additions & 0 deletions bianchimro/settings.py
Expand Up @@ -179,6 +179,9 @@
'sorl.thumbnail',
'imagestore.imagestore_cms',

#testing cms_js
'cms_jsapp',



)
Expand Down
13 changes: 12 additions & 1 deletion bianchimro/urls.py
Expand Up @@ -31,13 +31,24 @@
)


if settings.DEBUG:
if settings.DEBUG or True:
urlpatterns = patterns('',
url(r'^media/(?P<path>.*)$', 'django.views.static.serve',
{'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
) + urlpatterns

"""
if settings.DEBUG:
urlpatterns = patterns('',
url(r'', include('django.contrib.staticfiles.urls')),
) + urlpatterns
"""

from django.contrib.staticfiles.urls import staticfiles_urlpatterns
urlpatterns += staticfiles_urlpatterns()


#overrides
from overrides import *


0 comments on commit d0f3ec7

Please sign in to comment.