On corrige le cas des ical vides

This commit is contained in:
Jean-Marie Favreau 2024-09-21 20:56:03 +02:00
parent 38a7fd7e73
commit 67469cf339
2 changed files with 4 additions and 1 deletions

View File

@ -43,6 +43,9 @@ class DBImporterEvents:
except:
return (False, "JSON file is not correctly structured")
if len(structure) == 0:
return (True, "")
if "header" not in structure:
return (False, "JSON is not correctly structured: missing header")
if "events" not in structure:

View File

@ -214,7 +214,7 @@ class Extractor(ABC):
def get_structure(self):
if len(self.events) == 0:
return None
return {}
else:
return {"header": self.header, "events": self.events}