|
@@ -152,8 +152,8 @@ class Thread(models.Model):
|
|
|
from misago.acl.exceptions import ACLError403, ACLError404
|
|
|
from misago.models import ThreadRead, WatchedThread
|
|
|
|
|
|
- emailed = []
|
|
|
- for watch in WatchedThread.objects.filter(thread=self).filter(email=True).filter(last_read__gte=self.previous_last.date):
|
|
|
+ notified = []
|
|
|
+ for watch in WatchedThread.objects.filter(thread=self).filter(last_read__gte=self.previous_last.date):
|
|
|
user = watch.user
|
|
|
if user.pk != request.user.pk:
|
|
|
try:
|
|
@@ -162,16 +162,17 @@ class Thread(models.Model):
|
|
|
user_acl.threads.allow_thread_view(user, self)
|
|
|
user_acl.threads.allow_post_view(user, self, post)
|
|
|
if not user.is_ignoring(request.user):
|
|
|
- user.email_user(
|
|
|
- request,
|
|
|
- '%s_reply_notification' % thread_type,
|
|
|
- _('New reply in thread "%(thread)s"') % {'thread': self.name},
|
|
|
- {'author': request.user, 'post': post, 'thread': self}
|
|
|
- )
|
|
|
- emailed.append(user)
|
|
|
+ if watch.email:
|
|
|
+ user.email_user(
|
|
|
+ request,
|
|
|
+ '%s_reply_notification' % thread_type,
|
|
|
+ _('New reply in thread "%(thread)s"') % {'thread': self.name},
|
|
|
+ {'author': request.user, 'post': post, 'thread': self}
|
|
|
+ )
|
|
|
+ notified.append(user)
|
|
|
except (ACLError403, ACLError404):
|
|
|
pass
|
|
|
- return emailed
|
|
|
+ return notified
|
|
|
|
|
|
|
|
|
def rename_user_handler(sender, **kwargs):
|