diff --git a/assets/management/commands/generateSampleAssetsData.py b/assets/management/commands/generateSampleAssetsData.py index 00dcbcda..9399f655 100644 --- a/assets/management/commands/generateSampleAssetsData.py +++ b/assets/management/commands/generateSampleAssetsData.py @@ -68,7 +68,7 @@ class Command(BaseCommand): def create_cables(self): asset_description = ['The worm', 'Harting without a cap', 'Heavy cable', 'Extension lead', 'IEC cable that we should remember to prep'] - asset_prefixes = ["C","C4P","CBNC", "CDMX", "CDV", "CRCD", "CSOCA", "CXLR"] + asset_prefixes = ["C", "C4P", "CBNC", "CDMX", "CDV", "CRCD", "CSOCA", "CXLR"] csas = [0.75, 1.00, 1.25, 2.5, 4] lengths = [1, 2, 5, 10, 15, 20, 25, 30, 50, 100] @@ -96,16 +96,15 @@ class Command(BaseCommand): cores=random.choice(circuits) ) - if i % 5 == 0: - prefix = random.choice(asset_prefixes) - asset.asset_id = prefix + str(models.Asset.get_available_asset_id(wanted_prefix=prefix)) + prefix = random.choice(asset_prefixes) + asset.asset_id = prefix + str(models.Asset.get_available_asset_id(wanted_prefix=prefix)) if i % 4 == 0: asset.parent = models.Asset.objects.order_by('?').first() if i % 3 == 0: asset.purchased_from = random.choice(suppliers) - + asset.clean() asset.save()