mirror of
				https://github.com/paperless-ngx/paperless-ngx.git
				synced 2025-10-28 03:46:06 -05:00 
			
		
		
		
	Only delete the ContentTypes and Permissions once, not the loop (#4623)
This commit is contained in:
		| @@ -118,10 +118,10 @@ class Command(BaseCommand): | |||||||
|             # Fill up the database with whatever is in the manifest |             # Fill up the database with whatever is in the manifest | ||||||
|             try: |             try: | ||||||
|                 with transaction.atomic(): |                 with transaction.atomic(): | ||||||
|                     for manifest_path in manifest_paths: |  | ||||||
|                     # delete these since pk can change, re-created from import |                     # delete these since pk can change, re-created from import | ||||||
|                     ContentType.objects.all().delete() |                     ContentType.objects.all().delete() | ||||||
|                     Permission.objects.all().delete() |                     Permission.objects.all().delete() | ||||||
|  |                     for manifest_path in manifest_paths: | ||||||
|                         call_command("loaddata", manifest_path) |                         call_command("loaddata", manifest_path) | ||||||
|             except (FieldDoesNotExist, DeserializationError, IntegrityError) as e: |             except (FieldDoesNotExist, DeserializationError, IntegrityError) as e: | ||||||
|                 self.stdout.write(self.style.ERROR("Database import failed")) |                 self.stdout.write(self.style.ERROR("Database import failed")) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Trenton H
					Trenton H