def create_user self username password email site Creates new User Cre

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
def create_user(self, username, password, email, site=''):
"""
Creates a new User.
"""
# Create the user.
new_user = User(username=username, email=email)
new_user.set_password(password)
new_user.site = site
new_user.save()
return new_user