diff --git a/taiga/projects/userstories/signals.py b/taiga/projects/userstories/signals.py index aa346e8f..8a9c66c0 100644 --- a/taiga/projects/userstories/signals.py +++ b/taiga/projects/userstories/signals.py @@ -17,6 +17,7 @@ from contextlib import suppress from django.core.exceptions import ObjectDoesNotExist +from taiga.projects.history.services import take_snapshot #################################### # 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): if not created: instance.tasks.update(milestone=instance.milestone) + for task in instance.tasks.all(): + take_snapshot(task) #################################### diff --git a/taiga/timeline/signals.py b/taiga/timeline/signals.py index 5edc3850..f307fa4a 100644 --- a/taiga/timeline/signals.py +++ b/taiga/timeline/signals.py @@ -78,6 +78,9 @@ def on_new_history_entry(sender, instance, created, **kwargs): if instance.is_hidden: return None + if instance.user["pk"] is None: + return None + model = history_services.get_model_from_key(instance.key) pk = history_services.get_pk_from_key(instance.key) obj = model.objects.get(pk=pk)