diff --git a/src/agenda_culturel/models.py b/src/agenda_culturel/models.py index ab8ba29..042871f 100644 --- a/src/agenda_culturel/models.py +++ b/src/agenda_culturel/models.py @@ -1364,7 +1364,10 @@ class RecurrentImport(models.Model): events = BatchImportation.objects.filter(recurrentImport=self).order_by( "-created_date" ) - return events[0] + if events and len(events) > 0: + return events[0] + else: + return None class BatchImportation(models.Model): diff --git a/src/agenda_culturel/templates/agenda_culturel/rimports.html b/src/agenda_culturel/templates/agenda_culturel/rimports.html index 31eab13..8436981 100644 --- a/src/agenda_culturel/templates/agenda_culturel/rimports.html +++ b/src/agenda_culturel/templates/agenda_culturel/rimports.html @@ -82,7 +82,7 @@