Merge pull request #1854 from AliveDevil/feature/discussion-1832

Add django-scopes compatible django-admin dumpdata/loaddata commands
This commit is contained in:
vabene1111
2022-06-14 20:56:52 +02:00
committed by GitHub
2 changed files with 16 additions and 0 deletions

View File

@@ -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)

View File

@@ -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)