Skip to content
Snippets Groups Projects
Commit 6c167d00 authored by Ondrej Rehounek's avatar Ondrej Rehounek Committed by jan.bednarik
Browse files

district: handle datetime strings

parent 559d6675
No related branches found
No related tags found
2 merge requests!442Release,!432Feature/majak imports
...@@ -150,9 +150,10 @@ def import_post(path, file_path, parent, title_suffix, dry_run, repo_name): ...@@ -150,9 +150,10 @@ def import_post(path, file_path, parent, title_suffix, dry_run, repo_name):
if isinstance(meta_date, date): if isinstance(meta_date, date):
article.date = meta_date article.date = meta_date
else: else:
article.date = meta["date"].split()[0] parsed_date = meta["date"].split()[0]
article.date = parsed_date[0:10] if parsed_date else timezone.now().date()
else: else:
article.date = timezone.now() article.date = timezone.now().date()
article.title = meta["title"] article.title = meta["title"]
article.author = meta.get("author", "Česká pirátská strana") article.author = meta.get("author", "Česká pirátská strana")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment