Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Corrected the signals section to use post_save in the appropriate place.

Also added site to the email context
  • Loading branch information...
commit b16e8579b89ddb47bc323dd7fc6587ce46437f07 1 parent 9581c1a
James Turnbull authored

Showing 1 changed file with 5 additions and 3 deletions. Show diff stats Hide diff stats

  1. +5 3 comment_utils/moderation.py
8 comment_utils/moderation.py
@@ -323,8 +323,10 @@ def email(self, comment, content_object):
323 323 recipient_list = [manager_tuple[1] for manager_tuple in settings.MANAGERS]
324 324 t = loader.get_template('comment_utils/comment_notification_email.txt')
325 325 c = Context({ 'comment': comment,
326   - 'content_object': content_object })
327   - subject = '[%s] New comment posted on "%s"' % (Site.objects.get_current().name,
  326 + 'content_object': content_object,
  327 + 'site': Site.objects.get_current(),
  328 + })
  329 + subject = '[%s] Comment: "%s"' % (Site.objects.get_current().name,
328 330 content_object)
329 331 message = t.render(c)
330 332 send_mail(subject, message, settings.DEFAULT_FROM_EMAIL, recipient_list, fail_silently=True)
@@ -452,7 +454,7 @@ def connect(self):
452 454
453 455 """
454 456 signals.pre_save.connect(self.pre_save_moderation, sender=comments.get_model())
455   - signals.pre_save.connect(self.post_save_moderation, sender=comments.get_model())
  457 + signals.post_save.connect(self.post_save_moderation, sender=comments.get_model())
456 458
457 459 def register(self, model_or_iterable, moderation_class):
458 460 """

0 comments on commit b16e857

Please sign in to comment.
Something went wrong with that request. Please try again.