Fix suggested articles when no keyword

This commit is contained in:
Gabriel Augendre 2021-01-03 21:13:21 +01:00
parent 92fd0aac80
commit 2621796a6f
No known key found for this signature in database
GPG key ID: 1E693F4CE4AEE7B4

View file

@ -150,4 +150,6 @@ class Article(AdminUrlMixin, models.Model):
@cached_property
def get_formatted_keywords(self):
return list(map(lambda k: k.strip().lower(), self.keywords.split(",")))
return list(
filter(None, map(lambda k: k.strip().lower(), self.keywords.split(",")))
)