mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge pull request #879 from joeshaw/post-id
Wordpress import error on empty <wp:post_name>
This commit is contained in:
commit
1e203e955a
1 changed files with 3 additions and 0 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue