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

Commit ded27c4

Browse files
do not update tags when using -all script
1 parent 4cdea91 commit ded27c4

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

bugboard/management/commands/updatebbdb.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def handle(self, *args, **options):
6868
self.stdout.write(self.style.SUCCESS("Found api key."))
6969

7070
if options["all"]:
71-
self.update_db()
71+
self.update_db(False)
7272
self.update_local_tasks()
7373
self.update_local_comments()
7474
elif options["t"]:
@@ -78,7 +78,7 @@ def handle(self, *args, **options):
7878
else:
7979
self.update_db()
8080

81-
def update_db(self):
81+
def update_db(self, update_tags=True):
8282
"""Main function for creating local db, used later to update task list.
8383
"""
8484
# collect stats
@@ -91,7 +91,8 @@ def update_db(self):
9191
self.update_users()
9292
self.update_projects()
9393
self.update_tasks()
94-
self.update_tags()
94+
if update_tags:
95+
self.update_tags()
9596
self.update_assignees()
9697

9798
# collect stats
@@ -324,11 +325,11 @@ def update_task_details(self, id_project, t):
324325
self.task_tag_list.append([t["id"], t["tag_names"]])
325326
self.task_assignee_list.append([t["id"], t["assignee_ids"]])
326327

327-
# if updated task is closed, then delete it
328-
if task.status == "closed":
328+
# if updated task is closed or belongs to an inactive project, then delete it
329+
if task.status == "closed" or task.project.is_active is False:
329330
task.delete()
331+
# else save it
330332
else:
331-
# else save it
332333
task.save()
333334

334335
self.display_new_action()

0 commit comments

Comments
 (0)