17 lines
560 B
Python
17 lines
560 B
Python
# Django imports
|
|
# from django.contrib.auth.models import User
|
|
# from django.db.models.signals import post_save
|
|
# from django.dispatch import receiver
|
|
|
|
# # Local imports
|
|
# from .models import CustomUser
|
|
|
|
|
|
# @receiver(post_save, sender=User)
|
|
# def create_or_update_user_profile(sender, instance, created, **kwargs):
|
|
# if created:
|
|
# CustomUser.objects.get_or_create(user=instance)
|
|
# else:
|
|
# # Only save if customuser exists (avoid error if it doesn't)
|
|
# if hasattr(instance, 'customuser'):
|
|
# instance.customuser.save() |