We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from django.db.models.signals import post_save from django.contrib.auth.models import User from django.dispatch import receiver from .models import Profile from django.core.exceptions import ObjectDoesNotExist @receiver(post_save, sender = User) def create_profile(sender, instance, created, **kwargs): if created: Profile.objects.create(user=instance) @receiver(post_save, sender = User) def save_profile(sender, instance, created, **kwargs): try: instance.profile.save() except ObjectDoesNotExist: Profile.objects.create(user=instance)
error is at instance.profile.save() what to do to edit it?
The text was updated successfully, but these errors were encountered:
No branches or pull requests
error is at instance.profile.save() what to do to edit it?
The text was updated successfully, but these errors were encountered: