Skip to content

Commit

Permalink
add a validate method for DeleteChannelValidator so force_delete wont…
Browse files Browse the repository at this point in the history
… be ignored
  • Loading branch information
thesujai committed Sep 25, 2024
1 parent d95cb52 commit 7800af0
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions kolibri/core/content/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,15 @@ def diskexport(
class DeleteChannelValidator(ChannelResourcesValidator):
force_delete = serializers.BooleanField(default=False)

def validate(self, data):
job_data = super(ChannelResourcesValidator, self).validate(data)
job_data["kwargs"].update(
{
"force_delete": data.get("force_delete"),
}
)
return job_data


@register_task(
validator=DeleteChannelValidator,
Expand Down

0 comments on commit 7800af0

Please sign in to comment.