From 12ffeee494ee3de8896afce7397452e010fee72a Mon Sep 17 00:00:00 2001 From: Dylan McCall Date: Wed, 29 Jun 2022 13:31:01 -0700 Subject: [PATCH] Handle empty node_ids in importcontent If node_ids is set to an empty string, read it as an empty list, instead of a list with a single empty string. --- kolibri/core/content/management/commands/importcontent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kolibri/core/content/management/commands/importcontent.py b/kolibri/core/content/management/commands/importcontent.py index 25526c9f796..9f89967bcab 100644 --- a/kolibri/core/content/management/commands/importcontent.py +++ b/kolibri/core/content/management/commands/importcontent.py @@ -92,7 +92,7 @@ def add_arguments(self, parser): "--node_ids", "-n", # Split the comma separated string we get, into a list of strings - type=lambda x: x.split(","), + type=lambda x: x.split(",") if x else [], default=None, required=False, dest="node_ids", @@ -109,7 +109,7 @@ def add_arguments(self, parser): parser.add_argument( "--exclude_node_ids", # Split the comma separated string we get, into a list of string - type=lambda x: x.split(","), + type=lambda x: x.split(",") if x else [], default=None, required=False, dest="exclude_node_ids",