每当我创建超级用户时,它都会给我一个错误 Update_Profile() missing 1 required positional argument: 'self'.
@receiver(post_save, sender=User)
def Update_Profile(self, instance, created, **kwargs):
if created:
UserProfile.objects.create(user=instance)
instance.user_profile.save()
开满天机
相关分类