diff --git a/src/agenda_culturel/import_tasks/extractor_ical.py b/src/agenda_culturel/import_tasks/extractor_ical.py index b80c138..5d02b45 100644 --- a/src/agenda_culturel/import_tasks/extractor_ical.py +++ b/src/agenda_culturel/import_tasks/extractor_ical.py @@ -51,8 +51,6 @@ class ICALExtractor(Extractor): def extract( self, content, url, url_human=None, default_values=None, published=False ): - if content == "": - raise Exception(_('The source is empty')) warnings.filterwarnings("ignore", category=MarkupResemblesLocatorWarning) print("Extracting ical events from {}".format(url)) @@ -60,6 +58,9 @@ class ICALExtractor(Extractor): self.clear_events() self.uuids = {} + if content == "": + return self.get_structure() + calendar = icalendar.Calendar.from_ical(content) for event in calendar.walk("VEVENT"):