mirror of
https://github.com/tomasriveral/ReSSPublica.git
synced 2026-08-11 18:28:38 +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"])
|
||||
else:
|
||||
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)
|
||||
soup = BeautifulSoup(html, "html.parser")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user