A community-supported supercharged document management system: scan, index and archive all your documents
Python aiangulararchivingdjangodmsdocument-managementdocument-management-systemllmmachine-learningocroptical-character-recognitionpdf
Only delete the ContentTypes and Permissions once, not the loop (#4623)
Trenton Ha94e5d2e4706
diff --git a/src/documents/management/commands/document_importer.py b/src/documents/management/commands/document_importer.pyindex 7a3e40f28..9895104c3 100644--- a/src/documents/management/commands/document_importer.py+++ b/src/documents/management/commands/document_importer.py@@ -118,10 +118,10 @@ class Command(BaseCommand):# Fill up the database with whatever is in the manifesttry:with transaction.atomic():+ # delete these since pk can change, re-created from import+ ContentType.objects.all().delete()+ Permission.objects.all().delete()for manifest_path in manifest_paths:- # delete these since pk can change, re-created from import- ContentType.objects.all().delete()- Permission.objects.all().delete()call_command("loaddata", manifest_path)except (FieldDoesNotExist, DeserializationError, IntegrityError) as e:self.stdout.write(self.style.ERROR("Database import failed"))