Merge lp:~widelands-dev/widelands-website/queued_emails into lp:widelands-website

Proposed by kaputtnik
Status: Merged
Merged at revision: 523
Proposed branch: lp:~widelands-dev/widelands-website/queued_emails
Merge into: lp:widelands-website
Diff against target: 52 lines (+12/-3)
3 files modified
pybb/views.py (+2/-2)
settings.py (+9/-0)
wlmaps/models.py (+1/-1)
To merge this branch: bzr merge lp:~widelands-dev/widelands-website/queued_emails
Reviewer Review Type Date Requested Status
GunChleoc Approve
Review via email: mp+363951@code.launchpad.net

Commit message

Make use of a global setting to queue emails or not

Description of the change

Added a global setting to use a queue for emails. This makes it possible to queue emails on wl.widelands.org, but not on alpha.widelands.org.

So i do not have to run ./manage.py emit_notices manually on alpha.

After merging add

NOTIFICATION_QUEUE_ALL = True

to local_settings.py of wl.widelands.org

To post a comment you must log in.
Revision history for this message
GunChleoc (gunchleoc) wrote :

LGTM

review: Approve
Revision history for this message
kaputtnik (franku) wrote :

Thanks :-)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'pybb/views.py'
2--- pybb/views.py 2018-12-21 13:20:43 +0000
3+++ pybb/views.py 2019-03-05 09:11:39 +0000
4@@ -201,14 +201,14 @@
5 'post': post,
6 'user': post.topic.user
7 },
8- queue = True)
9+ )
10 # Topics author is subscriber for all new posts in his topic
11 post.topic.subscribers.add(request.user)
12
13 else:
14 # Send mails about a new post to topic subscribers
15 notification.send(post.topic.subscribers.exclude(username=post.user), 'forum_new_post',
16- {'post': post, 'topic': topic, 'user': post.user}, queue = True)
17+ {'post': post, 'topic': topic, 'user': post.user},)
18
19 return HttpResponseRedirect(post.get_absolute_url())
20
21
22=== modified file 'settings.py'
23--- settings.py 2019-02-26 13:32:06 +0000
24+++ settings.py 2019-03-05 09:11:39 +0000
25@@ -358,6 +358,15 @@
26 }
27 }
28
29+#########################
30+# Notification settings #
31+#########################
32+# When set to True, one has to run ./manage.py emit_notices
33+# for sending emails
34+
35+NOTIFICATION_QUEUE_ALL = False
36+
37+
38 try:
39 from local_settings import *
40 except ImportError:
41
42=== modified file 'wlmaps/models.py'
43--- wlmaps/models.py 2018-11-18 17:03:56 +0000
44+++ wlmaps/models.py 2019-03-05 09:11:39 +0000
45@@ -69,6 +69,6 @@
46 'user': self.uploader,
47 'uploader_comment': self.uploader_comment
48 },
49- queue=True)
50+ )
51
52 return map

Subscribers

People subscribed via source and target branches