#17318: 'Topic authentication', section 'Storing additional information about
users' there is bug in the code
---------------------------------+-------------------------
Reporter: supreet.sethi@… | Owner: nobody
Type: Bug | Status: new
Component: Documentation | Version: 1.3
Severity: Normal | Keywords: UserProfile
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+-------------------------
In the example code for creating profile using post_save event of User.
The code is written thus
{{{#!python
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.objects.create(user=instance)
}}}
Whereas it should be thus:
{{{#!python
def create_user_profile(sender, instance, created, **kwargs):
if created:
UserProfile.objects.create(user=instance).save()
}}}
Otherwise it generates "IntegrityError: column user_id is not unique"
error.
--
Ticket URL: <https://code.djangoproject.com/ticket/17318>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.