in pulseapi/users/models.py [0:0]
def create_user(self, name, email, password=None):
if not name:
raise ValueError('Users must have a name')
if not email:
raise ValueError('Users must have an email address')
if not password:
password = self.make_random_password()
# Ensure that new users get a user profile associated
# with them, even though it'll be empty by default.
# Is_active is set to False, so we can hide this
# user's profile and entries, until set to active by a moderator.
profile = UserProfile.objects.create(is_active=False)
user = self.model(
email=email,
name=name,
profile=profile,
)
user.set_password(password)
user.save()
return user