From 68b7cbded84033b37da14d0d95516d5b522ef7d3 Mon Sep 17 00:00:00 2001 From: Adolfo Fitoria Date: Thu, 13 Sep 2012 11:53:17 -0600 Subject: fixed bug when converting comments caused by db constraint, fixed styling errors --- askbot/skins/default/media/style/style.css | 2 ++ askbot/skins/default/media/style/style.less | 2 ++ askbot/views/writers.py | 7 ++++++- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/askbot/skins/default/media/style/style.css b/askbot/skins/default/media/style/style.css index 238a9fa1..f3ac27ad 100644 --- a/askbot/skins/default/media/style/style.css +++ b/askbot/skins/default/media/style/style.css @@ -1827,6 +1827,7 @@ ul#related-tags li { line-height: 18px; margin-top: -2px; margin-left: 4px; + box-shadow: none; } .question-page .post-controls .answer-convert input:hover, .question-page .answer-controls .answer-convert input:hover { @@ -2082,6 +2083,7 @@ ul#related-tags li { line-height: 14px; margin-left: 6px; font-size: 13px; + box-shadow: none; } .question-page .comments .comment-body .convert-comment input:hover { text-decoration: underline; diff --git a/askbot/skins/default/media/style/style.less b/askbot/skins/default/media/style/style.less index c311e53f..78351f8a 100644 --- a/askbot/skins/default/media/style/style.less +++ b/askbot/skins/default/media/style/style.less @@ -1776,6 +1776,7 @@ ul#related-tags li { line-height:18px; margin-top:-2px; margin-left:4px; + box-shadow: none; } .answer-convert input:hover{ @@ -1994,6 +1995,7 @@ ul#related-tags li { line-height: 14px; margin-left: 6px; font-size: 13px; + box-shadow: none; } .convert-comment input:hover{ diff --git a/askbot/views/writers.py b/askbot/views/writers.py index 4c7d3f4c..6f1efbbc 100644 --- a/askbot/views/writers.py +++ b/askbot/views/writers.py @@ -687,7 +687,12 @@ def comment_to_answer(request): comment.parent.comment_count += 1 comment.parent.save() - old_parent.comment_count -= 1 + #to avoid db constraint error + if old_parent.comment_count >= 1: + old_parent.comment_count -= 1 + else: + old_parent.comment_count = 0 + old_parent.save() comment.thread.invalidate_cached_data() -- cgit v1.2.3-1-g7c22