\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
\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