[Answered ]-Django signals for user profile (Customer and Employee)

1👍

You can do this by overriding the save method from the User model.

def save(self, *args, **kwargs):
    super().save(*args, **kwargs)
    if self.user_type == 'customer':
        CustomerProfile.objects.create(user=self)
    elif self.user_type == 'employee':
        EmployeeProfile.objects.create(user=self)

Leave a comment