From 1792fe9bf1aed97c56d388d81d3f1b396e97d025 Mon Sep 17 00:00:00 2001 From: Ramon Wenger Date: Thu, 5 Aug 2021 09:32:51 +0200 Subject: [PATCH] Change how slugs are generated in dummy data --- server/core/management/commands/dummy_data.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/server/core/management/commands/dummy_data.py b/server/core/management/commands/dummy_data.py index ed57cc08..1898ff21 100644 --- a/server/core/management/commands/dummy_data.py +++ b/server/core/management/commands/dummy_data.py @@ -1,6 +1,7 @@ import os import random import shutil +from uuid import uuid1 import wagtail_factories from django.conf import settings @@ -108,7 +109,7 @@ class Command(BaseCommand): for content_block_idx, content_block_data in enumerate(content_blocks_data): # ContentBlockFactory.create(parent=chapter, **self.filter_data(content_block_data, 'contents')) - ContentBlockFactory.create(parent=chapter, module=module, **content_block_data) + ContentBlockFactory.create(parent=chapter, module=module, slug=f'{uuid1()}', **content_block_data) # now create all and rooms management.call_command('dummy_rooms', verbosity=0)