python / pythondotorg

Source code for python.org
https://www.python.org
Apache License 2.0
1.5k stars 593 forks source link

Reduce the number of notification emails per job posting #656

Closed malemburg closed 9 years ago

malemburg commented 9 years ago

The jobs@python.org list is currently getting three notification emails with the same content for each job posting.

The emails have date/times about a second apart, e.g.

but otherwise look pretty identical.

This may be a simple misconfiguration of the mail system, but could also be the result of a bug in the jobs app.

malemburg commented 9 years ago

I'm starting to believe that we're hitting the problem described here: https://github.com/r4fek/django-cassandra-engine/issues/4 (for a different DB backend, but the issues looks very similar).

It's possible that post_save signals have an issue in Django 1.7.3.

malemburg commented 9 years ago

The signal is sent three times in each submission request, even for edits of existing records.

berkerpeksag commented 9 years ago

I've refactored to use AppConfig.ready() to register signals and I've confirmed that the on_job_was_submitted listener is registered once. But it didn't fixed the issue.

I also have created a custom signal instead of post_save and it didn't fixed the issue as well.

berkerpeksag commented 9 years ago

I don't think this is a Django bug. I've tested with Django 1.6, Django 1.7.2 and 1.7.6 and the issue is same.

malemburg commented 9 years ago

On 18.03.2015 23:28, Berker Peksag wrote:

I don't think this is a Django bug. I've tested with Django 1.6, Django 1.7.2 and 1.7.6 and the issue is same.

Hmm, then I don't understand why the "created" is apparently never set.

Marc-Andre Lemburg

berkerpeksag commented 9 years ago

Note: AppConfig verison is here: https://github.com/python/pythondotorg/compare/master...berkerpeksag:issue-656

malemburg commented 9 years ago

On 18.03.2015 23:48, Berker Peksag wrote:

Note: AppConfig verison is here: https://github.com/python/pythondotorg/compare/master...berkerpeksag:issue-656

Going forward that's certainly an improvement, even if it doesn't fix the issue at hand.

Could you post those changes as PR ?

Marc-Andre Lemburg

berkerpeksag commented 9 years ago

Well, I finally fixed the problem :) The problem is that we are saving self.object two times in views. Instead, we should have work on form.instance. I've opened https://github.com/python/pythondotorg/pull/671

malemburg commented 9 years ago

We're still getting two emails per change.

Also see #679.

berkerpeksag commented 9 years ago

https://github.com/python/pythondotorg/pull/680 should fix this.

malemburg commented 9 years ago

I can confirm that it's finally working. Thanks, @berkerpeksag

berkerpeksag commented 9 years ago

Great :)