def new_comment(object, comment): if isinstance(object, models.Page): comment.moderated = True comment.visible = True page = object domain = Site.objects.get_current().domain for name, email in settings.ADMINS: td = {} td['name'] = name td['comment'] = comment.content_text td['post'] = page.title td['url'] = "http://%s%s" % (domain, object.get_absolute_url()) mailer.send("admin/mail/newcomment.txt", td, "New Comment", email) else: raise broadcast.RejectBroadcast
def new_comment(object, comment): if isinstance(object, models.Post): comment.moderated = True comment.visible = True comment.group = "blog.%s" % object.blog.slug comment.save() domain = Site.objects.get_current().domain td = {} td["name"] = object.blog.owner.get_full_name() td["comment"] = comment.content_text td["post"] = object.title td["url"] = "http://%s%s#comment%s" % (domain, object.get_absolute_url(), comment.id) invalidate_cache(object) mailer.send("admin/mail/newcomment.txt", td, "New Comment", object.blog.owner.email) else: raise broadcast.RejectBroadcast
def new_comment(object, comment): if isinstance(object, models.Post): comment.moderated = True comment.visible = True comment.group = "blog.%s" % object.blog.slug comment.save() domain = Site.objects.get_current().domain td = {} td['name'] = object.blog.owner.get_full_name() td['comment'] = comment.content_text td['post'] = object.title td['url'] = "http://%s%s#comment%s" % (domain, object.get_absolute_url(), comment.id) invalidate_cache(object) mailer.send("admin/mail/newcomment.txt", td, "New Comment", object.blog.owner.email) else: raise broadcast.RejectBroadcast