Changeset 3807

Show
Ignore:
Timestamp:
12/04/07 20:53:40 (8 months ago)
Author:
roger
Message:

VisitFilter? now encodes lists to utf-8 properly (#1622).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/CHANGELOG.txt

    r3798 r3807  
    11TurboGears Changelog 
    22==================== 
     3 
     4 
     51.0.4: 
     6------ 
     7 
     8Fixes 
     9~~~~~ 
     10 
     11* Fixed VisitFilter when Identity is on and there are list parameters (#1622). 
    312 
    413 
  • branches/1.0/turbogears/identity/tests/test_identity.py

    r3771 r3807  
    448448        assert 'identity_failed_answer' in firstline, firstline 
    449449 
     450    def test_decode_filter2(self): 
     451        """Test that the decode filter doesn't break with list 
     452        variables and Identity""" 
     453        testutil.create_request('/in_admin_group?a=1&a=2') 
     454        firstline = cherrypy.response.body[0] 
     455        assert 'identity_failed_answer' in firstline, firstline 
     456 
    450457class TestTGUser(testutil.DBTest): 
    451458    model = TG_User 
  • branches/1.0/turbogears/visit/api.py

    r3792 r3807  
    181181            res = dict() 
    182182            for k, v in params.items(): 
    183                 if type(v) is dict
     183                if isinstance(v, dict)
    184184                    res[k] = encode_utf8(v) 
    185  
     185                elif isinstance(v, list): 
     186                    res[k] = [vv.encode('utf-8') for vv in v] 
    186187                else: 
    187188                    res[k] = v.encode('utf-8')