Skip to content
Snippets Groups Projects
Commit 4849e004 authored by André Anjos's avatar André Anjos :speech_balloon:
Browse files

[utils] Handle backup and re-store of optional apps in a better way

parent c2ecace5
No related branches found
No related tags found
No related merge requests found
...@@ -59,6 +59,7 @@ APPS = [ #dump and load order are respected ...@@ -59,6 +59,7 @@ APPS = [ #dump and load order are respected
'search', 'search',
'reports', 'reports',
'actstream', 'actstream',
'post_office',
] ]
......
...@@ -74,6 +74,10 @@ class Command(BaseCommand): ...@@ -74,6 +74,10 @@ class Command(BaseCommand):
def add_arguments(self, parser): def add_arguments(self, parser):
parser.add_argument('-e', '--exclude', dest='exclude', action='append',
default=[], help='An app_label to exclude (use multiple ' \
'--exclude to exclude multiple apps).')
parser.add_argument('backup', type=str, parser.add_argument('backup', type=str,
help='The backup you wish to restore from') help='The backup you wish to restore from')
...@@ -115,6 +119,7 @@ class Command(BaseCommand): ...@@ -115,6 +119,7 @@ class Command(BaseCommand):
# and loads the apps respecting the imposed order # and loads the apps respecting the imposed order
for app in APPS: for app in APPS:
if app in arguments.get('exclude'): continue
# copy prefix data # copy prefix data
path = os.path.join(settings.PREFIX, app) path = os.path.join(settings.PREFIX, app)
srcdir = os.path.join(tmpdir, 'prefix', app) srcdir = os.path.join(tmpdir, 'prefix', app)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment