

def email(self, comment, content_object, request):
    content_object = comment.content_object
    if content_object.blog.editorial_moderators:
        editorial_moderators = content_object.blog.editorial_moderators
        editor_emails = []
        for editor in editorial_moderators.all():
            eds = editor.tenure_set.filter(current=True)
            for ed in eds.all():
                if ed.editor.email:
                    editor_emails.append(ed.editor.email)
    if content_object.blog.staff_moderators:
        staff_moderators = content_object.blog.staff_moderators
        staff_emails = []
        for staffer in staff_moderators.all():
            staff_emails.append(staffer.email)
    moderators = content_object.blog.moderators
    moderators = moderators.split(',')
    for each_moderator in moderators:
        each_moderator = each_moderator.strip()
    moderators.extend(staff_emails)
    moderators.extend(editor_emails)
    context = {
        'comment': comment,
        'content_object': content_object,
    }
    subject = ('New comment awaiting moderation on "%s"' % content_object)
    render_email_and_send(context=context, message_template='blogs/comment_notification_email.txt', subject=subject, recipients=moderators)

dataset/ETHPy150Open albatrossandco/brubeck_cms/brubeck/blogs/models.py EntryModerator.email/original