Si le fichier est vide, on ne lève pas d'erreur
This commit is contained in:
parent
00eb45c687
commit
1c20ac93bf
@ -51,8 +51,6 @@ class ICALExtractor(Extractor):
|
|||||||
def extract(
|
def extract(
|
||||||
self, content, url, url_human=None, default_values=None, published=False
|
self, content, url, url_human=None, default_values=None, published=False
|
||||||
):
|
):
|
||||||
if content == "":
|
|
||||||
raise Exception(_('The source is empty'))
|
|
||||||
warnings.filterwarnings("ignore", category=MarkupResemblesLocatorWarning)
|
warnings.filterwarnings("ignore", category=MarkupResemblesLocatorWarning)
|
||||||
|
|
||||||
print("Extracting ical events from {}".format(url))
|
print("Extracting ical events from {}".format(url))
|
||||||
@ -60,6 +58,9 @@ class ICALExtractor(Extractor):
|
|||||||
self.clear_events()
|
self.clear_events()
|
||||||
self.uuids = {}
|
self.uuids = {}
|
||||||
|
|
||||||
|
if content == "":
|
||||||
|
return self.get_structure()
|
||||||
|
|
||||||
calendar = icalendar.Calendar.from_ical(content)
|
calendar = icalendar.Calendar.from_ical(content)
|
||||||
|
|
||||||
for event in calendar.walk("VEVENT"):
|
for event in calendar.walk("VEVENT"):
|
||||||
|
Loading…
Reference in New Issue
Block a user