def moderate(moderator, comment, visibility): comment.visibility = visibility comment.judged = True comment.save() CommentModerationLog.append( user=comment.author, comment=comment, moderator=moderator, visibility=visibility, ) comment.visibility_changed() update_freeze()
def moderate(comment, visibility, moderator=None): if moderator: comment.judged = True comment.visibility = visibility comment.save() if moderator: CommentModerationLog.append( user=comment.author, comment=comment, moderator=moderator, visibility=visibility, ) comment.visibility_changed()