Only delete the ContentTypes and Permissions once, not the loop
This commit is contained in:
parent
ed34815393
commit
11ed59dc29
@ -118,10 +118,10 @@ class Command(BaseCommand):
|
||||
# Fill up the database with whatever is in the manifest
|
||||
try:
|
||||
with transaction.atomic():
|
||||
for manifest_path in manifest_paths:
|
||||
# delete these since pk can change, re-created from import
|
||||
ContentType.objects.all().delete()
|
||||
Permission.objects.all().delete()
|
||||
for manifest_path in manifest_paths:
|
||||
call_command("loaddata", manifest_path)
|
||||
except (FieldDoesNotExist, DeserializationError, IntegrityError) as e:
|
||||
self.stdout.write(self.style.ERROR("Database import failed"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user