On gère mieux les urls sans événement
This commit is contained in:
parent
9bb3373f99
commit
1c812a3d65
@ -243,6 +243,7 @@ def import_events_from_url(self, url, cat):
|
||||
url, published=False, default_values=values
|
||||
)
|
||||
|
||||
if events:
|
||||
# convert it to json
|
||||
json_events = json.dumps(events, default=str)
|
||||
|
||||
@ -251,6 +252,8 @@ def import_events_from_url(self, url, cat):
|
||||
|
||||
# finally, close task
|
||||
close_import_task(self.request.id, success, error_message, importer)
|
||||
else:
|
||||
close_import_task(self.request.id, False, "Cannot find any event", importer)
|
||||
except Exception as e:
|
||||
logger.error(e)
|
||||
close_import_task(self.request.id, False, e, importer)
|
||||
|
@ -264,6 +264,8 @@ class FacebookEventExtractor(Extractor):
|
||||
event["category"] = default_values["category"]
|
||||
self.add_event(**event)
|
||||
return self.get_structure()
|
||||
else:
|
||||
logger.warning("cannot find any event in page")
|
||||
|
||||
|
||||
return None
|
||||
|
@ -66,5 +66,4 @@ class GoogleCalendarLinkEventExtractor(Extractor):
|
||||
break
|
||||
|
||||
|
||||
logger.warning("ça marche")
|
||||
return self.get_structure()
|
Loading…
Reference in New Issue
Block a user