Note: I am using a custom user model in Django and not a default user model (replaced username with email)
def create_member(sender, instance,created, **kwargs):
if created:
if not instance.is_staff:
try:
Member.objects.create(first_name=instance.first_name, last_name=instance.last_name, django_user_id=instance.id)
except:
pass
post_save.connect(create_member,sender=User)
This creates an instance of Member when an instance of CustomUser is created, but Under customuser the users email disappears.
If I remove "django_user_id=instance.id" everything is normal but, django_user is unassigned as expected.
Note: I am using a custom user model in Django and not a default user model (replaced username with email)
This creates an instance of Member when an instance of CustomUser is created, but Under customuser the users email disappears. If I remove "django_user_id=instance.id" everything is normal but, django_user is unassigned as expected.
How can I create an instance of member class ?