emencia / emencia-django-newsletter

An app for sending newsletter by email to a contact list.
189 stars 72 forks source link

already_sent problem? #4

Closed martip closed 14 years ago

martip commented 14 years ago

Hi Julien, it's me again.

I found a little problem in mailer.py. If I understood well, the already_sent list is supposed to contain a list of Contact objects id. Instead, the following line in mailer.py (line 92 in current trunk)

already_sent = ContactMailingStatus.objects.filter(status=ContactMailingStatus.SENT,
            newsletter=self.newsletter).values_list('id', flat=True)

populates the list with ContactMailingStatus objects id! I believe that the line should be written as:

already_sent = ContactMailingStatus.objects.filter(status=ContactMailingStatus.SENT,
            newsletter=self.newsletter).values_list('contact__id', flat=True)

What do you think? Paolo

Fantomas42 commented 14 years ago

Hello, good job for this report, and effectively it seems to be a bug.

I will write some tests to raise the bug and fix it with your correction.