kolibri icon indicating copy to clipboard operation
kolibri copied to clipboard

Use new content management utility functions for import channel and delete content

Open thesujai opened this issue 8 months ago • 8 comments

While the recent refactoring of content management commands (see #9266) has improved our codebase, there are still instances where the legacy approach is used. Specifically, in the following locations: DeleteContent Delete Content ImportChannel

Instead of invoking the management commands in these cases, we should update the code to use the corresponding utility functions: For importing a channel, use: content.utils.channel_transfer.transfer_channel For deleting content, use: content.utils.content_delete.delete_content

This change will keep our code up-to-date with our latest updates and make unit testing must simpler

thesujai avatar Mar 31 '25 15:03 thesujai

hi @rtibbles could you please assign this issue to me?

manuaishika avatar Mar 31 '25 21:03 manuaishika

Hi @manuaishika - I have assigned you as you just got in first, please let me know how you plan to tackle this issue.

rtibbles avatar Apr 01 '25 16:04 rtibbles

@KumarVivekPathak are you serious? https://github.com/learningequality/kolibri/blob/develop/kolibri/core/content/utils/content_delete.py

It's right there.

This makes me suspect that this github comment was generated by an LLM - please consider the content of what you post and don't use the output of an LLM without any critical reflection.

rtibbles avatar Apr 01 '25 16:04 rtibbles

Automatically unassigning @manuaishika due to no comments here, or updates on the associated pull request for 1 month. @manuaishika, if you're still interested in this issue or already have work in progress, please message us here, and we'll assign you again. Thank you!

Hi @rtibbles @thesujai, can I help with this? Also just to be sure, I'm assuming there are other instances with legacy code apart from the ones mentioned in the issue?

iamshobhraj avatar May 09 '25 20:05 iamshobhraj

Hi @iamshobhraj! I will assign this issue to you! For now, let's stick to the scope of the issue and resolve only the places the issue mentions, regardless of whether there are other instances with legacy code.

AlexVelezLl avatar May 13 '25 14:05 AlexVelezLl

@AlexVelezLl i opened a pr related to this issue. can you review it?

iamshobhraj avatar May 18 '25 15:05 iamshobhraj

Thanks @iamshobhraj! I'll take a look at it this week :)

AlexVelezLl avatar May 19 '25 14:05 AlexVelezLl

Closed by #13411

AlexVelezLl avatar Jun 20 '25 14:06 AlexVelezLl