From eeae09be5e6327d8e5dec0269dbd908648d1c79e Mon Sep 17 00:00:00 2001 From: Joe Shaw Date: Wed, 4 Dec 2013 09:45:33 -0500 Subject: [PATCH] wordpress importer: fallback onto wp:post_id if wp:post_name is empty --- pelican/tools/pelican_import.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pelican/tools/pelican_import.py b/pelican/tools/pelican_import.py index a5711b31..e3599f0e 100755 --- a/pelican/tools/pelican_import.py +++ b/pelican/tools/pelican_import.py @@ -126,6 +126,9 @@ def wp2fields(xml): content = item.find('encoded').string filename = item.find('post_name').string + if filename is None: + filename = item.find('post_id').string + raw_date = item.find('post_date').string date_object = time.strptime(raw_date, "%Y-%m-%d %H:%M:%S") date = time.strftime("%Y-%m-%d %H:%M", date_object)