mirror of
https://github.com/tomasriveral/ReSSPublica.git
synced 2026-08-12 02:38:37 +02:00
fix: default date observation to today if no url
This commit is contained in:
@@ -28,6 +28,9 @@ def extract_announcement_date(observationId, observationUrl):
|
|||||||
return date.fromisoformat(db.get(q.id == observationId)["date"])
|
return date.fromisoformat(db.get(q.id == observationId)["date"])
|
||||||
else:
|
else:
|
||||||
logger.debug(f"observation {str(observationId)} is a new observation.")
|
logger.debug(f"observation {str(observationId)} is a new observation.")
|
||||||
|
if observationUrl == "-":
|
||||||
|
# for some reason some observations have "-" as the url
|
||||||
|
return date.today()
|
||||||
html = fetchUrlToHtml(observationUrl)
|
html = fetchUrlToHtml(observationUrl)
|
||||||
soup = BeautifulSoup(html, "html.parser")
|
soup = BeautifulSoup(html, "html.parser")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user