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
q_filter, subscription_settings__subscribed_questions='i', subscription_settings__enable_notifications=True\r
).exclude(id=comment.user.id).distinct()\r
\r
q_filter, subscription_settings__subscribed_questions='i', subscription_settings__enable_notifications=True\r
).exclude(id=comment.user.id).distinct()\r
\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
send_template_email(subscribers, "notifications/newmember.html", {'newmember': action.user})\r
\r
UserJoinsAction.hook(member_joined)\r
send_template_email(subscribers, "notifications/newmember.html", {'newmember': action.user})\r
\r
UserJoinsAction.hook(member_joined)\r