Skip to content

Commit

Permalink
change cleaned_title() to append the post_id
Browse files Browse the repository at this point in the history
  • Loading branch information
nickmoreton committed Jan 3, 2022
1 parent 6bc2b29 commit 98659a3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion wagtail_wordpress_import/importers/wordpress.py
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,11 @@ def prefilter_content(self, content):
return cached_result

def cleaned_title(self):
return self.node["title"].strip()
title = self.node.get("title", None)
if title:
return title.strip()
else:
return "no-title-available-{}".format(self.node.get("wp:post_id"))

def cleaned_slug(self):
"""
Expand Down

0 comments on commit 98659a3

Please sign in to comment.