# from django.db.models.signals import post_save
# from django.dispatch import receiver
# from tasks.models import Task, TaskAssignment, TaskEvent

# @receiver(post_save, sender=Task)
# def create_task_event_on_update(sender, instance, created, **kwargs):
#     if created:
#         TaskEvent.objects.create(
#             task=instance,
#             event_type='created',
#             user=instance.reporter,
#             details={'status': instance.status}
#         )
#     else:
#         TaskEvent.objects.create(
#             task=instance,
#             event_type='updated',
#             user=instance.reporter,
#             details={'status': instance.status}
#         )

# @receiver(post_save, sender=TaskAssignment)
# def create_task_assignment_event(sender, instance, created, **kwargs):
#     if created:
#         TaskEvent.objects.create(
#             task=instance.task,
#             event_type='reassigned',
#             user=instance.assigned_by,
#             details={
#                 'assigned_to': instance.assigned_to.id,
#                 'assigned_by': instance.assigned_by.id,
#                 'status_after': instance.status_after
#             }
#         )
