On garde les événements sans titre ou date, mais on les non-publie
This commit is contained in:
parent
280f04d22f
commit
1b15ea6b2b
@ -5,7 +5,6 @@ import unicodedata
|
|||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class Extractor(ABC):
|
class Extractor(ABC):
|
||||||
url_referer=None
|
url_referer=None
|
||||||
|
|
||||||
@ -177,12 +176,17 @@ class Extractor(ABC):
|
|||||||
image=None,
|
image=None,
|
||||||
image_alt=None,
|
image_alt=None,
|
||||||
):
|
):
|
||||||
|
comments = ''
|
||||||
if title is None:
|
if title is None:
|
||||||
print("ERROR: cannot import an event without name")
|
print("WARNING: cannot publish an event without name")
|
||||||
return
|
published = False
|
||||||
|
title = _('Unknown title')
|
||||||
if start_day is None:
|
if start_day is None:
|
||||||
print("ERROR: cannot import an event without start day")
|
print("WARNING: cannot publish an event without start day")
|
||||||
return
|
published = False
|
||||||
|
start_day = datetime.now().date()
|
||||||
|
comments = 'Warning: the date has not been imported correctly.'
|
||||||
|
title += ' - Warning: the date has not been imported correctly.'
|
||||||
|
|
||||||
tags_default = self.default_value_if_exists(default_values, "tags")
|
tags_default = self.default_value_if_exists(default_values, "tags")
|
||||||
if not tags_default:
|
if not tags_default:
|
||||||
@ -203,6 +207,11 @@ class Extractor(ABC):
|
|||||||
"email": self.default_value_if_exists(default_values, "email"),
|
"email": self.default_value_if_exists(default_values, "email"),
|
||||||
"comments": self.default_value_if_exists(default_values, "comments"),
|
"comments": self.default_value_if_exists(default_values, "comments"),
|
||||||
}
|
}
|
||||||
|
if event["comments"] is None:
|
||||||
|
event["comments"] = comments
|
||||||
|
else:
|
||||||
|
event["comments"] += '\n' + comments
|
||||||
|
|
||||||
# TODO: pourquoi url_human et non reference_url
|
# TODO: pourquoi url_human et non reference_url
|
||||||
if url_human is not None:
|
if url_human is not None:
|
||||||
event["url_human"] = url_human
|
event["url_human"] = url_human
|
||||||
|
Loading…
x
Reference in New Issue
Block a user