Cosmetics: post_save-ing a CofProfile now with decorators.

This commit is contained in:
Michele Orrù 2017-01-04 22:37:03 +01:00
parent 8016078e4f
commit 542d02ca6d

View file

@ -79,10 +79,10 @@ class CofProfile(models.Model):
return six.text_type(self.user.username)
@receiver(post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
CofProfile.objects.get_or_create(user=instance)
post_save.connect(create_user_profile, sender=User)
@receiver(post_delete, sender=CofProfile)