'Generates a new password and sets it to the user'

def generate_new_password(self, size=8):

    password = ''.join([random.choice((string.letters + string.digits)) for i in range(size)])
    self.user.set_password(password)
    self.user.save()
    return password
