from django.db.models.signals import post_save
from django.dispatch import receiver
from django.contrib.auth.models import User


@receiver(post_save, sender=User)
def create_employee_for_user(sender, instance, created, **kwargs):
    """Auto-create an Employee record whenever a User is created."""
    from financial.models import Employee
    if created:
        Employee.objects.get_or_create(user=instance)
