widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #16192
[Merge] lp:~widelands-dev/widelands-website/queued_emails into lp:widelands-website
kaputtnik has proposed merging lp:~widelands-dev/widelands-website/queued_emails into lp:widelands-website.
Commit message:
Make use of a global setting to queue emails or not
Requested reviews:
Widelands Developers (widelands-dev)
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands-website/queued_emails/+merge/363951
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
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands-website/queued_emails into lp:widelands-website.
=== modified file 'pybb/views.py'
--- pybb/views.py 2018-12-21 13:20:43 +0000
+++ pybb/views.py 2019-03-05 09:11:39 +0000
@@ -201,14 +201,14 @@
'post': post,
'user': post.topic.user
},
- queue = True)
+ )
# Topics author is subscriber for all new posts in his topic
post.topic.subscribers.add(request.user)
else:
# Send mails about a new post to topic subscribers
notification.send(post.topic.subscribers.exclude(username=post.user), 'forum_new_post',
- {'post': post, 'topic': topic, 'user': post.user}, queue = True)
+ {'post': post, 'topic': topic, 'user': post.user},)
return HttpResponseRedirect(post.get_absolute_url())
=== modified file 'settings.py'
--- settings.py 2019-02-26 13:32:06 +0000
+++ settings.py 2019-03-05 09:11:39 +0000
@@ -358,6 +358,15 @@
}
}
+#########################
+# Notification settings #
+#########################
+# When set to True, one has to run ./manage.py emit_notices
+# for sending emails
+
+NOTIFICATION_QUEUE_ALL = False
+
+
try:
from local_settings import *
except ImportError:
=== modified file 'wlmaps/models.py'
--- wlmaps/models.py 2018-11-18 17:03:56 +0000
+++ wlmaps/models.py 2019-03-05 09:11:39 +0000
@@ -69,6 +69,6 @@
'user': self.uploader,
'uploader_comment': self.uploader_comment
},
- queue=True)
+ )
return map
Follow ups