Skip to content

Commit c4476d1

Browse files
committed
whitespace handled in comments
1 parent 0f5877f commit c4476d1

File tree

2 files changed

+3
-14
lines changed

2 files changed

+3
-14
lines changed

django_comments/templates/index.html

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,6 @@
66
/** @jsx React.DOM */
77
var CommentBox = React.createClass({
88
getInitialState: function() {
9-
// $.ajax({
10-
// url : "getcomments/",
11-
// type : "POST",
12-
// success : function(data) {
13-
// console.log('success - '+ JSON.stringify(data));
14-
// return data;
15-
// },
16-
// error : function(xhr,errmsg,err) {
17-
// console.log('err');
18-
// console.log(xhr.status + ": " + xhr.responseText);
19-
// return {data: []};
20-
// }
21-
// });
229
return {data: []};
2310
},
2411
loadCommentsFromServer: function() {

django_comments/views.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,11 @@ def getComments(request):
4747
data = Comments.objects.all()
4848
comments = []
4949
for obj in data:
50+
obj_comment = obj.comment
51+
obj_comment_refined = obj_comment.replace ("+", " ");
5052
commentCurr = {
5153
"author": obj.user_id,
52-
"text": obj.comment,
54+
"text": obj_comment_refined,
5355
"post_id": obj.post_id,
5456
}
5557
comments.append(commentCurr)

0 commit comments

Comments
 (0)