On corrige le cas des ical vides
This commit is contained in:
parent
38a7fd7e73
commit
67469cf339
@ -43,6 +43,9 @@ class DBImporterEvents:
|
|||||||
except:
|
except:
|
||||||
return (False, "JSON file is not correctly structured")
|
return (False, "JSON file is not correctly structured")
|
||||||
|
|
||||||
|
if len(structure) == 0:
|
||||||
|
return (True, "")
|
||||||
|
|
||||||
if "header" not in structure:
|
if "header" not in structure:
|
||||||
return (False, "JSON is not correctly structured: missing header")
|
return (False, "JSON is not correctly structured: missing header")
|
||||||
if "events" not in structure:
|
if "events" not in structure:
|
||||||
|
@ -214,7 +214,7 @@ class Extractor(ABC):
|
|||||||
|
|
||||||
def get_structure(self):
|
def get_structure(self):
|
||||||
if len(self.events) == 0:
|
if len(self.events) == 0:
|
||||||
return None
|
return {}
|
||||||
else:
|
else:
|
||||||
return {"header": self.header, "events": self.events}
|
return {"header": self.header, "events": self.events}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user