mirror of
https://github.com/TandoorRecipes/recipes.git
synced 2026-01-10 00:28:22 -05:00
Merge pull request #1854 from AliveDevil/feature/discussion-1832
Add django-scopes compatible django-admin dumpdata/loaddata commands
This commit is contained in:
8
cookbook/management/commands/export.py
Normal file
8
cookbook/management/commands/export.py
Normal 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)
|
||||
8
cookbook/management/commands/import.py
Normal file
8
cookbook/management/commands/import.py
Normal 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)
|
||||
Reference in New Issue
Block a user