On Sat, Oct 11, 2008 at 4:39 AM, NoviceSortOf <[EMAIL PROTECTED]> wrote:

>
> These lines in forms.py
> -----------------------------------------------------------------------
> 92.  new_user =
>
> RegistrationProfile.objects.create_inactive_user(username=self.cleaned_data['username'],
>   93. password=self.cleaned_data['password1'],
>  94. first_name=self.cleaned_data['first_name'],
>  95. last_name=self.cleaned_data['last_name'],
>  96. email=self.cleaned_data['email'],
>  97. profile_callback=profile_callback)
>
> Return this error
> ------------------------------------------------------------------------
> create_inactive_user() got an unexpected keyword argument 'first_name'
>
> Note: first_name and last_name fields already exist in auth_user
>      they are original fields along with username and password,
>      it seems it would easy to add them to the form and save them.
>

Only create_inactive_user isn't coded to expect or use them, as the message
says.  So since you can't pass them in when you create the
RegistrationProfile object you need to leave the create_inactive_user call
as it was.  Once you've created new_user, you can set the fields in the
related User object and save it with code something like:

new_user.user.first_name = self.cleaned_data['first_name']
new_user.user.last_name = self.cleaned_data['last_name']
new_user.user.save()

Karen

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to