Auto slug/summary/SEO and deterministic tag colours #65
@@ -274,7 +274,10 @@ class TagMetadata(models.Model):
|
||||
"border": "border-zinc-600/20 dark:border-zinc-400/20",
|
||||
},
|
||||
}
|
||||
return mapping.get(self.colour, get_auto_tag_colour_css(self.tag.name))
|
||||
css = mapping.get(self.colour)
|
||||
if css is not None:
|
||||
return css
|
||||
return get_auto_tag_colour_css(self.tag.name)
|
||||
|
||||
|
||||
class ArticlePageAdminForm(WagtailAdminPageForm):
|
||||
|
||||
@@ -164,13 +164,13 @@ def test_article_save_auto_generates_slug_from_title(home_page):
|
||||
author = AuthorFactory()
|
||||
article = ArticlePage(
|
||||
title="My Great Article",
|
||||
slug="my-great-article",
|
||||
slug="",
|
||||
author=author,
|
||||
summary="summary",
|
||||
body=[("rich_text", "<p>body</p>")],
|
||||
)
|
||||
index.add_child(instance=article)
|
||||
article.save()
|
||||
article.refresh_from_db()
|
||||
assert article.slug == "my-great-article"
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user