Django

Code

Changeset 4708

Show
Ignore:
Timestamp:
03/12/07 04:21:22 (2 years ago)
Author:
mtredinnick
Message:

Fixed #3640 -- Improved error handling in views.i18n.set_language(). Thanks
Jorge Gajon.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/AUTHORS

    r4691 r4708  
    8686    favo@exoweb.net 
    8787    Eric Floehr <eric@intellovations.com> 
     88    Jorge Gajon <gajon@gajon.org> 
    8889    gandalf@owca.info 
    8990    Baishampayan Ghose 
  • django/trunk/django/views/i18n.py

    r4265 r4708  
    1010    Redirect to a given url while setting the chosen language in the 
    1111    session or cookie. The url and the language code need to be 
    12     specified in the GET paramters. 
     12    specified in the GET parameters. 
    1313    """ 
    14     lang_code = request.GET['language'] 
     14    lang_code = request.GET.get('language', None) 
    1515    next = request.GET.get('next', None) 
    1616    if not next: 
     
    1919        next = '/' 
    2020    response = http.HttpResponseRedirect(next) 
    21     if check_for_language(lang_code): 
     21    if lang_code and check_for_language(lang_code): 
    2222        if hasattr(request, 'session'): 
    2323            request.session['django_language'] = lang_code