Remove unused code

This commit is contained in:
Lorenz Padberg 2024-02-26 11:50:36 +01:00
parent 817284ab4c
commit 4e7443906d
1 changed files with 4 additions and 7 deletions

View File

@ -15,12 +15,6 @@ logger = getLogger(__name__)
class Command(BaseCommand): class Command(BaseCommand):
def handle(self, *args, **options): 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() migrate_objectives_to_content()
@ -61,7 +55,7 @@ def migrate_objectives_to_content():
if default_objectives or custom_objectives_by_owner: if default_objectives or custom_objectives_by_owner:
contentblocks_by_merged_objectives_ids = {} 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 # - one ownsers custom objectives must not be changed by another owner
# - visibility is set per class # - visibility is set per class
for owner, owner_objectives in custom_objectives_by_owner.items(): for owner, owner_objectives in custom_objectives_by_owner.items():
@ -126,6 +120,9 @@ def migrate_objectives_to_content():
default_content_block.save() default_content_block.save()
except ValidationError as e: except ValidationError as e:
print(f"Error with module {module}") print(f"Error with module {module}")
logger.error(e) logger.error(e)