summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/lib/django_comments/views/comments.py13
-rw-r--r--design/templates/comments/posted.html5
2 files changed, 11 insertions, 7 deletions
diff --git a/app/lib/django_comments/views/comments.py b/app/lib/django_comments/views/comments.py
index 22e061c..7c7f4df 100644
--- a/app/lib/django_comments/views/comments.py
+++ b/app/lib/django_comments/views/comments.py
@@ -123,13 +123,14 @@ def post_comment(request, next=None, using=None):
"comment_will_be_posted receiver %r killed the comment" % receiver.__name__)
# Save the comment and signal that it was saved
- if comment.user != 'HenryLom':
+ print(comment.user_name)
+ if comment.user_name != 'HenryLom':
comment.save()
- signals.comment_was_posted.send(
- sender=comment.__class__,
- comment=comment,
- request=request
- )
+ signals.comment_was_posted.send(
+ sender=comment.__class__,
+ comment=comment,
+ request=request
+ )
return next_redirect(request, fallback=next or 'comments-comment-done',
c=comment._get_pk_val())
diff --git a/design/templates/comments/posted.html b/design/templates/comments/posted.html
index 9a478cf..e5fed65 100644
--- a/design/templates/comments/posted.html
+++ b/design/templates/comments/posted.html
@@ -13,7 +13,10 @@
document.getElementById('countdown').innerHTML = timeLeft;
if(timeLeft === 0){
clearInterval(cinterval);
- window.location="{{comment.content_object.get_absolute_url}}";
+ {% if not comment.content_object.get_absolute_url %}
+ window.location="/";
+ {% else%}
+ window.location="{{comment.content_object.get_absolute_url}}";{%endif%}
}
};