from forum.models import User, Question, Comment, QuestionSubscription, SubscriptionSettings, Answer\r
from forum.utils.mail import send_template_email\r
from django.utils.translation import ugettext as _\r
from forum.models import User, Question, Comment, QuestionSubscription, SubscriptionSettings, Answer\r
from forum.utils.mail import send_template_email\r
from django.utils.translation import ugettext as _\r
- if question.author.subscription_settings.questions_asked:\r
- subscription = QuestionSubscription(question=question, user=question.author)\r
- subscription.save()\r
+ subscription = QuestionSubscription(question=question, user=question.author)\r
+ subscription.save()\r
\r
subscribers = question.subscribers.filter(\r
subscription_settings__enable_notifications=True,\r
\r
subscribers = question.subscribers.filter(\r
subscription_settings__enable_notifications=True,\r
subscription_settings__subscribed_questions='i'\r
).exclude(id=action.node.nstate.accepted.by.id).distinct()\r
subscription_settings__subscribed_questions='i'\r
).exclude(id=action.node.nstate.accepted.by.id).distinct()\r
subscribers = filter_subscribers(subscribers)\r
\r
send_template_email(subscribers, "notifications/answeraccepted.html", {'answer': action.node})\r
subscribers = filter_subscribers(subscribers)\r
\r
send_template_email(subscribers, "notifications/answeraccepted.html", {'answer': action.node})\r