From 83e4ac5900434b89cc980091240c5dca5e72a905 Mon Sep 17 00:00:00 2001 From: helllllllder Date: Mon, 25 Oct 2021 18:12:06 -0300 Subject: [PATCH] add condition to remove None values from the knowledge_bases_languages list --- bothub/common/models.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/bothub/common/models.py b/bothub/common/models.py index 18ae00dd..52aa5061 100644 --- a/bothub/common/models.py +++ b/bothub/common/models.py @@ -601,7 +601,8 @@ def available_languages(self, language=None, queryset=None, version_default=True ) else: knowledge_bases_languages = list(set(self.knowledge_bases.values_list("texts__language", flat=True))) - knowledge_bases_languages.remove(None) + if None in knowledge_bases_languages: + knowledge_bases_languages.remove(None) return knowledge_bases_languages @property