1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

take django_language either from GET or POST (GET has preference if both

are given)


git-svn-id: http://code.djangoproject.com/svn/django/branches/i18n@769 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Georg Bauer 2005-10-03 12:20:18 +00:00
parent 4196ff0b17
commit 5e24a67952

View File

@ -185,8 +185,8 @@ def get_language_from_request(request):
"""
global _accepted
if request.GET:
lang = request.GET.get('django_language', None)
if request.GET or request.POST:
lang = request.GET.get('django_language', None) or request.POST.get('django_language', None)
if lang is not None:
if hasattr(request, 'session'):
request.session['django_language'] = lang