Skip to content

Commit

Permalink
Handle empty node_ids in importcontent
Browse files Browse the repository at this point in the history
If node_ids is set to an empty string, read it as an empty list,
instead of a list with a single empty string.
  • Loading branch information
dylanmccall committed Jul 13, 2022
1 parent 963bf9d commit 12ffeee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kolibri/core/content/management/commands/importcontent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down

0 comments on commit 12ffeee

Please sign in to comment.