Merge pull request #879 from joeshaw/post-id

Wordpress import error on empty <wp:post_name>
This commit is contained in:
Justin Mayer 2013-12-18 18:24:16 -08:00
commit 1e203e955a

View file

@ -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)