Skip to content
This repository was archived by the owner on Apr 7, 2020. It is now read-only.

Commit 4cdea91

Browse files
add -all command that will launch updatedb(), update_local_tasks() & update_local_comments()
1 parent be109b5 commit 4cdea91

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

bugboard/management/commands/updatebbdb.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ def add_arguments(self, parser):
4444
help="Update all tasks (get admin urls, last update infos...).",
4545
)
4646
parser.add_argument(
47-
"-c", action="store_true", help="Update comments list for each stored task."
47+
"-c", action="store_true",
48+
help="Update comments list for each stored task."
49+
)
50+
parser.add_argument(
51+
"--all", action="store_true",
52+
help="Launch all the updates provided by the other commands one after one."
4853
)
4954

5055
def handle(self, *args, **options):
@@ -62,15 +67,19 @@ def handle(self, *args, **options):
6267

6368
self.stdout.write(self.style.SUCCESS("Found api key."))
6469

65-
if options["t"]:
70+
if options["all"]:
71+
self.update_db()
72+
self.update_local_tasks()
73+
self.update_local_comments()
74+
elif options["t"]:
6675
self.update_local_tasks()
6776
elif options["c"]:
6877
self.update_local_comments()
6978
else:
7079
self.update_db()
7180

7281
def update_db(self):
73-
"""Main function, will call all update-functions one after one.
82+
"""Main function for creating local db, used later to update task list.
7483
"""
7584
# collect stats
7685
users_before = Member.objects.all().count()

0 commit comments

Comments
 (0)