#NEWLINE# def create_profile( self , user , * args , **kwargs ) : #NEWLINE# #INDENT# "\n        Create an instance of this manager's object class for a given\n        ``User``, and return it.\n\n        The activation key will be a SHA1 hash, generated from a combination\n        of the ``User``'s username and a random salt.\n        " #NEWLINE# salt = hashlib . sha1 ( str ( random . random ( ) ) ) . hexdigest ( ) [ : 5 ] #NEWLINE# activation_key = hashlib . sha1 ( ( salt + user . username ) ) . hexdigest ( ) #NEWLINE# return self . create ( user = user , activation_key = activation_key , ** kwargs )