Closed geokollias closed 14 years ago
Effectively this bug can occur. I will write some tests to reproduce the problem and solve it.
Thank you for the report. Is it a real case ?
Fortunately, it occurred during manual testing :) Btw, thank you for such a useful app.
Test writed, bug fixed. 20651fba05701bba6651f3b6e1989d39c24e6c3f
Perfect. Thnx :)
Also, in my machine, tests break at test_expedition_set() because 'unsubscribers_id' in 'MailingList.expedition_set()' is a ValuesListQuerySet and 'exclude(id__in=unsubscribers_id)' doesn't seem to work well with it (it doesn 't see the contacts' ids). However, when i change it to a pure list of ints ('exclude(id__in=[id for id in unsubscribers_id])'), i dont have any problem. Do you face the same problem?
It's strange because I didn't have the problem, and values_list with flat=True, must return a list.
Which version of Django do you use ? How do you launch the tests ?
values_list with flat=True return ValuesListQuerySet to me. I use version 1.2.1 and i launch them with django's 'manage.py test'
Ok, can you report this in another issue, with a dump of your datas ?
A ZeroDivisionError could happen @ get_newsletter_opening_statistics view @ utils/statistics.py, if all newsletter's mailling list's subscribers have unsubscribed.