mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-04-02 13:45:10 -05:00
Merge pull request #3487 from paperless-ngx/fix/issue-3484
Fix: exclude consumer & AnonymousUser users from export manifest
This commit is contained in:
commit
eb0f35219c
@ -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()),
|
||||
|
@ -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,
|
||||
|
Loading…
x
Reference in New Issue
Block a user