Issue 3641: taiga-back joins milestone task change and the next task change

remotes/origin/logger
Alejandro Alonso 2016-01-15 10:30:28 +01:00 committed by David Barragán Merino
parent 8530276a54
commit 915557bbb4
2 changed files with 6 additions and 0 deletions

View File

@ -17,6 +17,7 @@
from contextlib import suppress from contextlib import suppress
from django.core.exceptions import ObjectDoesNotExist from django.core.exceptions import ObjectDoesNotExist
from taiga.projects.history.services import take_snapshot
#################################### ####################################
# Signals for cached prev US # Signals for cached prev US
@ -47,6 +48,8 @@ def update_role_points_when_create_or_edit_us(sender, instance, **kwargs):
def update_milestone_of_tasks_when_edit_us(sender, instance, created, **kwargs): def update_milestone_of_tasks_when_edit_us(sender, instance, created, **kwargs):
if not created: if not created:
instance.tasks.update(milestone=instance.milestone) instance.tasks.update(milestone=instance.milestone)
for task in instance.tasks.all():
take_snapshot(task)
#################################### ####################################

View File

@ -78,6 +78,9 @@ def on_new_history_entry(sender, instance, created, **kwargs):
if instance.is_hidden: if instance.is_hidden:
return None return None
if instance.user["pk"] is None:
return None
model = history_services.get_model_from_key(instance.key) model = history_services.get_model_from_key(instance.key)
pk = history_services.get_pk_from_key(instance.key) pk = history_services.get_pk_from_key(instance.key)
obj = model.objects.get(pk=pk) obj = model.objects.get(pk=pk)