diff --git a/src/documents/management/commands/document_exporter.py b/src/documents/management/commands/document_exporter.py index b916538e7..fba89695b 100644 --- a/src/documents/management/commands/document_exporter.py +++ b/src/documents/management/commands/document_exporter.py @@ -250,7 +250,12 @@ class Command(BaseCommand): manifest += json.loads(serializers.serialize("json", Group.objects.all())) - manifest += json.loads(serializers.serialize("json", User.objects.all())) + manifest += json.loads( + serializers.serialize( + "json", + User.objects.exclude(username__in=["consumer", "AnonymousUser"]), + ), + ) manifest += json.loads( serializers.serialize("json", UiSettings.objects.all()), diff --git a/src/documents/tests/test_management_exporter.py b/src/documents/tests/test_management_exporter.py index e0b0e3543..e7c116caf 100644 --- a/src/documents/tests/test_management_exporter.py +++ b/src/documents/tests/test_management_exporter.py @@ -141,7 +141,14 @@ class TestExportImport(DirectoriesMixin, FileSystemAssertsMixin, TestCase): manifest = self._do_export(use_filename_format=use_filename_format) - self.assertEqual(len(manifest), 12) + self.assertEqual(len(manifest), 10) + + # dont include consumer or AnonymousUser users + self.assertEqual( + len(list(filter(lambda e: e["model"] == "auth.user", manifest))), + 1, + ) + self.assertEqual( len(list(filter(lambda e: e["model"] == "documents.document", manifest))), 4,