Skip to content
This repository has been archived by the owner on Oct 22, 2019. It is now read-only.

Update FAQ to Work with Current Version of Django #556

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions docs/faq.rst
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@ form. First you override the signup form and add the fields.
"""
super(SignupFormExtra, self).__init__(*args, **kw)
# Put the first and last name at the top
new_order = self.fields.keyOrder[:-2]
new_order.insert(0, 'first_name')
new_order.insert(1, 'last_name')
self.fields.keyOrder = new_order
new_order = self.fields
new_order.move_to_end('last_name', last=False)
new_order.move_to_end('first_name', last=False)
self.fields= new_order

def save(self):
"""
Expand All @@ -135,7 +135,7 @@ form. First you override the signup form and add the fields.
# Get the profile, the `save` method above creates a profile for each
# user because it calls the manager method `create_user`.
# See: https://github.com/bread-and-pepper/django-userena/blob/master/userena/managers.py#L65
user_profile = new_user.get_profile()
user_profile = new_user.my_profile

user_profile.first_name = self.cleaned_data['first_name']
user_profile.last_name = self.cleaned_data['last_name']
Expand Down