1
0
Fork 0
forked from github/pelican

wordpress importer: fallback onto wp:post_id if wp:post_name is empty

This commit is contained in:
Joe Shaw 2013-12-04 09:45:33 -05:00
commit eeae09be5e

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)