From 4e7443906de1c324c2ca48aa199fe872c2508813 Mon Sep 17 00:00:00 2001 From: Lorenz Padberg Date: Mon, 26 Feb 2024 11:50:36 +0100 Subject: [PATCH] Remove unused code --- .../commands/migrate_objectives_to_content.py | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/server/books/management/commands/migrate_objectives_to_content.py b/server/books/management/commands/migrate_objectives_to_content.py index 4bc7f8a5..53997929 100644 --- a/server/books/management/commands/migrate_objectives_to_content.py +++ b/server/books/management/commands/migrate_objectives_to_content.py @@ -15,12 +15,6 @@ logger = getLogger(__name__) class Command(BaseCommand): def handle(self, *args, **options): - ContentBlock.objects.filter(title__startswith="TESTOBJECTIVE").delete() - ContentBlock.objects.filter(title__startswith="CUSTOM").delete() - Chapter.objects.filter(title__startswith="TESTOBJECTIVE").delete() - ContentBlock.objects.filter(title__startswith="XXX").delete() - Chapter.objects.filter(title__startswith="XXX").delete() - migrate_objectives_to_content() @@ -61,7 +55,7 @@ def migrate_objectives_to_content(): if default_objectives or custom_objectives_by_owner: contentblocks_by_merged_objectives_ids = {} - # cor custom objectives iterate over owners, + # for custom objectives iterate over owners, # - one ownsers custom objectives must not be changed by another owner # - visibility is set per class for owner, owner_objectives in custom_objectives_by_owner.items(): @@ -126,6 +120,9 @@ def migrate_objectives_to_content(): default_content_block.save() + + + except ValidationError as e: print(f"Error with module {module}") logger.error(e)