Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support content renderable_only option in tasks API #11519

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions kolibri/core/content/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ def validate(self, data):

class ChannelResourcesImportValidator(ChannelResourcesValidator):
update = serializers.BooleanField(default=False)
renderable_only = serializers.BooleanField(default=True)
fail_on_error = serializers.BooleanField(default=False)
new_version = serializers.IntegerField(required=False)
all_thumbnails = serializers.BooleanField(default=False)
Expand All @@ -109,6 +110,7 @@ def validate(self, data):
job_data["kwargs"].update(
{
"update": data.get("update"),
"renderable_only": data.get("renderable_only"),
"fail_on_error": data.get("fail_on_error"),
"all_thumbnails": data.get("all_thumbnails"),
}
Expand Down Expand Up @@ -158,6 +160,7 @@ def diskcontentimport(
update=False,
node_ids=None,
exclude_node_ids=None,
renderable_only=True,
fail_on_error=False,
all_thumbnails=False,
):
Expand All @@ -171,6 +174,7 @@ def diskcontentimport(
drive_id=drive_id,
node_ids=node_ids,
exclude_node_ids=exclude_node_ids,
renderable_only=renderable_only,
fail_on_error=fail_on_error,
all_thumbnails=all_thumbnails,
)
Expand Down Expand Up @@ -247,6 +251,7 @@ def remotecontentimport(
node_ids=None,
exclude_node_ids=None,
update=False,
renderable_only=True,
fail_on_error=False,
all_thumbnails=False,
):
Expand All @@ -259,6 +264,7 @@ def remotecontentimport(
peer_id=peer_id,
node_ids=node_ids,
exclude_node_ids=exclude_node_ids,
renderable_only=renderable_only,
fail_on_error=fail_on_error,
all_thumbnails=all_thumbnails,
)
Expand Down Expand Up @@ -525,6 +531,7 @@ def remoteimport(
node_ids=None,
exclude_node_ids=None,
update=False,
renderable_only=True,
fail_on_error=False,
all_thumbnails=False,
):
Expand All @@ -549,6 +556,7 @@ def remoteimport(
peer_id=peer_id,
node_ids=node_ids,
exclude_node_ids=exclude_node_ids,
renderable_only=renderable_only,
fail_on_error=fail_on_error,
all_thumbnails=all_thumbnails,
)
Expand All @@ -570,6 +578,7 @@ def diskimport(
update=False,
node_ids=None,
exclude_node_ids=None,
renderable_only=True,
fail_on_error=False,
all_thumbnails=False,
):
Expand All @@ -596,6 +605,7 @@ def diskimport(
path=drive.datafolder,
drive_id=drive_id,
node_ids=node_ids,
renderable_only=renderable_only,
exclude_node_ids=exclude_node_ids,
fail_on_error=fail_on_error,
all_thumbnails=all_thumbnails,
Expand Down