Last active
December 4, 2017 22:37
-
-
Save bencleary/1b4f1aeff0312e166400f2e495d95e04 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.dispatch import receiver | |
from django.db.models.signals import post_save | |
from .models import * | |
@receiver(post_save, sender=MyCustomUser) | |
def build_profile_on_user_creation(sender, instance, created, **kwargs): | |
if created: | |
profile = MyProfile(user=instance) | |
profile.save() | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment