diff options
author | luxagraf <sng@luxagraf.net> | 2018-11-02 15:01:05 -0600 |
---|---|---|
committer | luxagraf <sng@luxagraf.net> | 2018-11-02 15:01:05 -0600 |
commit | 68abc78a9a543697d8f176775a052c1d70e371a4 (patch) | |
tree | 8d440951fa1786d2ac62a3836079a979bb812fae /apps/accounts/signals.py |
added some basic user models and tests
Diffstat (limited to 'apps/accounts/signals.py')
-rw-r--r-- | apps/accounts/signals.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/apps/accounts/signals.py b/apps/accounts/signals.py new file mode 100644 index 0000000..5aac623 --- /dev/null +++ b/apps/accounts/signals.py @@ -0,0 +1,12 @@ +from django.db.models.signals import post_save +from django.dispatch import receiver + +from .models import User, UserProfile + + +@receiver(post_save, sender=User) +def create_profile(sender, update_fields, created, instance, **kwargs): + """ creates a blank profile when a new user signs up """ + if created: + user_profile = UserProfile(user=instance) + user_profile.save() |