diff --git a/cookbook/management/commands/export.py b/cookbook/management/commands/export.py new file mode 100644 index 000000000..82322a665 --- /dev/null +++ b/cookbook/management/commands/export.py @@ -0,0 +1,8 @@ +from django.core.management.commands.dumpdata import Command as DumpdataCommand +from django_scopes import scopes_disabled + + +class Command(DumpdataCommand): + def handle(self, *args, **options): + with scopes_disabled(): + return super().handle(*args, **options) diff --git a/cookbook/management/commands/import.py b/cookbook/management/commands/import.py new file mode 100644 index 000000000..986993c06 --- /dev/null +++ b/cookbook/management/commands/import.py @@ -0,0 +1,8 @@ +from django.core.management.commands.loaddata import Command as LoaddataCommand +from django_scopes import scopes_disabled + + +class Command(LoaddataCommand): + def handle(self, *args, **options): + with scopes_disabled(): + return super().handle(*args, **options)