Updated the closed signal in the task model to close the milestone of the saved task if all us have task and all are closed
parent
8d56f7efc8
commit
649df99977
|
@ -146,8 +146,9 @@ def tasks_close_handler(sender, instance, **kwargs):
|
||||||
|
|
||||||
# Milestone
|
# Milestone
|
||||||
if instance.milestone:
|
if instance.milestone:
|
||||||
if instance.status.is_closed and not instance.milestone.closed and all([
|
if (instance.status.is_closed and not instance.milestone.closed and
|
||||||
t.status.is_closed for t in instance.milestone.tasks.all()]):
|
all([t.status.is_closed for t in instance.milestone.tasks.all()]) and
|
||||||
|
all([us.status.is_closed for us in instance.milestone.user_stories.all()])):
|
||||||
instance.milestone.closed = True
|
instance.milestone.closed = True
|
||||||
instance.milestone.save()
|
instance.milestone.save()
|
||||||
elif not instance.status.is_closed and instance.milestone.closed:
|
elif not instance.status.is_closed and instance.milestone.closed:
|
||||||
|
|
Loading…
Reference in New Issue