from django.db.models.signals import post_save\r
-from forum.models.meta import vote_canceled\r
+from forum.models.base import mark_canceled\r
from forum.models.answer import answer_accepted, answer_accepted_canceled\r
\r
from forum.models import *\r
\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
\r
post.author.reputes.create(value=repute_value, question=question, reputation_type=repute_type)\r
\r
-vote_canceled.connect(on_vote_canceled)\r
+mark_canceled.connect(on_vote_canceled, sender=Vote)\r
\r
\r
\r