Add mixin classes for required keys in EntityDescription (#53610)

This commit is contained in:
Marc Mueller
2021-07-28 11:50:13 +02:00
committed by GitHub
parent 6d13466f8a
commit 553521a76b
6 changed files with 60 additions and 65 deletions

View File

@@ -79,9 +79,9 @@ def sanitize_path(path: str) -> str:
return path
def slugify(text: str, *, separator: str = "_") -> str:
def slugify(text: str | None, *, separator: str = "_") -> str:
"""Slugify a given text."""
if text == "":
if text == "" or text is None:
return ""
slug = unicode_slug.slugify(text, separator=separator)
return "unknown" if slug == "" else slug