from django.db import models
from django.contrib.auth.models import User

STANDARD_EMAIL = "anonymous@readthedocs.org"

class UserProfile (models.Model):
    """Additional information about a User.
    """
    user = models.ForeignKey(User, unique=True, related_name='profile')
    whitelisted = models.BooleanField()
    homepage = models.CharField(max_length=100, blank=True)
    allow_email = models.BooleanField(help_text='Show your email on VCS contributions.', default=True)

    def get_absolute_url(self):
        return ('profiles_profile_detail', (), {'username': self.user.username})
    get_absolute_url = models.permalink(get_absolute_url)

    def __unicode__(self):
        return "%s's profile" % self.user.username

    def get_contribution_details(self):
        """
        Gets the line to put into commits to attribute the author.

        Returns a tuple (name, email)
        """
        if self.user.first_name and self.user.last_name:
            name = '%s %s' % (self.user.first_name, self.user.last_name)
        else:
            name = self.user.username
        if self.allow_email:
            email = self.user.email
        else:
            email = STANDARD_EMAIL
        return (name, email)

@@ -22,16 +22,100 @@
  models%0A
+from django.db.models.signals import post_save%0Afrom django.dispatch import receiver%0A
 from dja
@@ -1293,20 +1293,213 @@
 eturn (name, email)%0A
+%0A%0A@receiver(post_save, sender=User)%0Adef create_profile(sender, **kwargs):%0A    if kwargs%5B'created'%5D is True:%0A        UserProfile.objects.create(user_id=kwargs%5B'instance'%5D.id, whitelisted=False)%0A

Add post save signal for user creation