summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdolfo Fitoria <adolfo.fitoria@gmail.com>2012-09-13 11:53:17 -0600
committerAdolfo Fitoria <adolfo.fitoria@gmail.com>2012-09-13 11:53:17 -0600
commit68b7cbded84033b37da14d0d95516d5b522ef7d3 (patch)
treeed5bea5656d728ef826bafaa9c638873872e219d
parent2e6653f348a7496f7be08c919c8197e4ca8c1a6d (diff)
downloadaskbot-68b7cbded84033b37da14d0d95516d5b522ef7d3.tar.gz
askbot-68b7cbded84033b37da14d0d95516d5b522ef7d3.tar.bz2
askbot-68b7cbded84033b37da14d0d95516d5b522ef7d3.zip
fixed bug when converting comments caused by db constraint, fixed styling errors
-rw-r--r--askbot/skins/default/media/style/style.css2
-rw-r--r--askbot/skins/default/media/style/style.less2
-rw-r--r--askbot/views/writers.py7
3 files changed, 10 insertions, 1 deletions
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()