def set_random_password(self):
     password = get_random_string(12)
     self.update_password(password)
     self.save()
     return password
 def set_random_password(self):
     password = get_random_string(12)
     self.update_password(password)
     self.save()
     return password
 def update_password(self, string):
     '''Update our password to a new one whilst hashing it.'''
     self.salt = get_random_string(12)
     self.password = hasher(self.salt + string)
 def update_password(self, string):
     '''Update our password to a new one whilst hashing it.'''
     self.salt = get_random_string(12)
     self.password = hasher(self.salt+string)