title: UserProfile Registration erases all rows
body: <p>I have created a user registration view and this is it:</p>
  
  <pre><code>def register(request):
  if request.method == 'POST':
      data = request.POST.copy() # so we can manipulate data  
      # random username
      data['username'] = hashlib.md5( data['email'] ).hexdigest()
      data['username'] = data['username'][0:30]
      #data['username'] = ''.join([choice(letters) for i in xrange(30)])
      form = RegisterForm(data)   
      if form.is_valid():
          new_user = form.save()
          #UserProfile.objects.create(user=new_user)
          return HttpResponse("Thanks for Registering")       
  else:
      form = RegisterForm()
  
  return render_to_response("CTUser/register.html", { 'form': form, })
  </code></pre>
  
  <p>When I uncommented the UserProfile line:</p>
  
  <pre><code>#UserProfile.objects.create(user=new_user)
  </code></pre>
  
  <p>the email and password are saved correctly, but when It is there, all the info is erased. Am I doing something wrong here?</p>
  
  <p>here is the UserProfile classs:</p>
  
  <pre><code>class UserProfile(User):
  user = models.OneToOneField(User)
  #user = models.ForeignKey(User, unique=True)
  
  #profile sub URL
  pagelink = models.CharField(max_length=40)
  
  #one or many albums
  albums = models.ManyToManyField(Album)
  </code></pre>
  
  <p>UPDATE(10/19/11):
  Here is the registration form function:</p>
  
  <pre><code>class RegisterForm(UserCreationForm):   
  email = forms.EmailField(label = "Email Address", max_length=75)  
  
  class Meta:
      model = User
      #exclude = ['username',]
      fields = ("username", "email")  
  
  def clean_email(self):
      email = self.cleaned_data["email"]
      try:
          user = User.objects.get(email=email)
          raise forms.ValidationError("This email address already exists. Did you forget your password?")
      except User.DoesNotExist:
          return email
  
  def save(self, commit=True):
      user = super(UserCreationForm, self).save(commit=False)
      user.set_password(self.cleaned_data["password1"])
      user.email = self.cleaned_data["email"]
      user.is_active = True # change to false if using email activation
      if commit:
          user.save()
      return user
  </code></pre>