correct comparison done for emailing

This commit is contained in:
Serghei Mihai 2014-05-14 10:44:47 +02:00
parent 3234c916a1
commit 4b2dfbdb34
1 changed files with 1 additions and 1 deletions

View File

@ -23,7 +23,7 @@ class Command(BaseCommand):
famille__liaisonnameidfamille__isnull=False, paye=False):
try:
notification = InvoiceNotificationEmail.objects.filter(invoice_number=invoice.id).latest()
if notification.date_sent < make_aware(datetime.now(), get_current_timezone()) - timedelta(days=notification_timeout):
if notification.date_sent > make_aware(datetime.now(), get_current_timezone()) - timedelta(days=notification_timeout):
continue
except InvoiceNotificationEmail.DoesNotExist:
InvoiceNotificationEmail.objects.create(invoice_number=invoice.id)