Minor cleanup

This commit is contained in:
Aarni Halinen
2019-09-28 19:52:14 +03:00
parent 0da0a02bac
commit b58dbde83c
+1 -10
View File
@@ -235,16 +235,7 @@ class Official(models.Model):
@receiver(post_save, sender=Official)
def create_user_profile(sender, instance, created, **kwargs):
if created:
instance.user.first_name = instance.first_name
instance.user.last_name = instance.last_name
instance.user.email = instance.email
instance.user.save()
@receiver(post_save, sender=Official)
def save_user_profile(sender, instance, **kwargs):
def save_user_official(sender, instance, **kwargs):
instance.user.first_name = instance.first_name
instance.user.last_name = instance.last_name
instance.user.email = instance.email