'Shared helper that creates a res.partner out of a token'

def do_signup(self, qcontext):

    values = {key: qcontext.get(key) for key in ('login', 'name', 'password')}
    assert values.values(), 'The    form    was    not    properly    filled    in.'
    assert (values.get('password') == qcontext.get('confirm_password')), 'Passwords    do    not    match;    please    retype    them.'
    supported_langs = [lang['code'] for lang in request.env['res.lang'].sudo().search_read([], ['code'])]
    if (request.lang in supported_langs):
        values['lang'] = request.lang
    self._signup_with_values(qcontext.get('token'), values)
    request.env.cr.commit()
