]> git.openstreetmap.org Git - osqa.git/blobdiff - forum/reputation.py
OSQA - 19
[osqa.git] / forum / reputation.py
index 8ee3469ba27b62205c440a32064a8260f9c1e3ac..71f9d65fd7a5c8abb0c99bb52eb5b553f3083ad6 100644 (file)
@@ -58,7 +58,7 @@ answer_accepted_canceled.connect(on_answer_accepted)
 \r
 \r
 def on_vote(instance, created, **kwargs):\r
-    if created and not instance.content_object.wiki:\r
+    if created and (instance.content_object.node_type in ("question", "answer") and not instance.content_object.wiki):\r
         post = instance.content_object.leaf\r
         question = (post.__class__ == Question) and post or post.question\r
 \r
@@ -79,7 +79,7 @@ post_save.connect(on_vote, sender=Vote)
 \r
 \r
 def on_vote_canceled(instance, **kwargs):\r
-    if not instance.content_object.wiki:\r
+    if instance.content_object.node_type in ("question", "answer") and not instance.content_object.wiki:\r
         post = instance.content_object.leaf\r
         question = (post.__class__ == Question) and post or post.question\r
 \r