Python 3 fixes
This commit is contained in:
1 parent
b69f917d57
commit
ec638d51f9
8 files changed
+61
-47
No files matched your search
@@ -0,0 +1,11 @@
|
||||
from django.contrib.auth.models import User
|
||||
from django.db.models.signals import post_save
|
||||
from django.dispatch import receiver
|
||||
from main.models import UserProfile
|
||||
|
||||
|
||||
@receiver(post_save, sender=User, dispatch_uid='randomz')
|
||||
def create_user_profile(sender, instance, created, **kwargs):
|
||||
# Create a new UserProfile object when we create a new User.
|
||||
if created:
|
||||
UserProfile.objects.create(user=instance)
|
||||
Reference in new issue
Block a user