My favorites
▼
|
Sign in
django-forum
Simple Django Forum Component
Project Home
Wiki
Issues
Source
Export to GitHub
READ-ONLY: This project has been
archived
. For more information see
this post
.
Search
Search within:
All issues
Open issues
New issues
Issues to verify
for
Advanced search
Search tips
Subscriptions
Issue
77
attachment: views.patch
(2.5 KB)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
--- views.py 2009-08-05 13:49:52.000000000 +0200
+++ ../../apps/forum/views.py 2009-08-05 19:53:38.000000000 +0200
@@ -127,33 +127,34 @@
if sub:
sub.delete()
- # Subscriptions are updated now send mail to all the authors subscribed in
- # this thread.
- mail_subject = ''
- try:
- mail_subject = settings.FORUM_MAIL_PREFIX
- except AttributeError:
- mail_subject = '[Forum]'
-
- mail_from = ''
- try:
- mail_from = settings.FORUM_MAIL_FROM
- except AttributeError:
- mail_from = settings.DEFAULT_FROM_EMAIL
-
- mail_tpl = loader.get_template('forum/notify.txt')
- c = Context({
- 'body': wordwrap(striptags(body), 72),
- 'site' : Site.objects.get_current(),
- 'thread': t,
- })
-
- email = EmailMessage(
- subject=mail_subject+' '+striptags(t.title),
- body= mail_tpl.render(c),
- from_email=mail_from,
- bcc=[s.author.email for s in t.subscription_set.all()],)
- email.send(fail_silently=True)
+ if t.subscription_set.count() > 0:
+ # Subscriptions are updated now send mail to all the authors subscribed in
+ # this thread.
+ mail_subject = ''
+ try:
+ mail_subject = settings.FORUM_MAIL_PREFIX
+ except AttributeError:
+ mail_subject = '[Forum]'
+
+ mail_from = ''
+ try:
+ mail_from = settings.FORUM_MAIL_FROM
+ except AttributeError:
+ mail_from = settings.DEFAULT_FROM_EMAIL
+
+ mail_tpl = loader.get_template('forum/notify.txt')
+ c = Context({
+ 'body': wordwrap(striptags(body), 72),
+ 'site' : Site.objects.get_current(),
+ 'thread': t,
+ })
+
+ email = EmailMessage(
+ subject=mail_subject+' '+striptags(t.title),
+ body= mail_tpl.render(c),
+ from_email=mail_from,
+ bcc=[s.author.email for s in t.subscription_set.all()],)
+ email.send(fail_silently=True)
return HttpResponseRedirect(p.get_absolute_url())
else:
Powered by
Google Project Hosting