(sender, **kwargs)
Whenever a user logs in, attempt to set their browser session
    to the right language.
    HT: http://mirobetm.blogspot.com/2012/02/django-language-set-in-database-field.html
Whenever a user logs in, attempt to set their browser session
    to the right language.
    HT: http://mirobetm.blogspot.com/2012/02/django-language-set-in-database-field.html
Whenever a user logs in attempt to set their browser session to the right language . HT : http : // mirobetm . blogspot . com / 2012 / 02 / django - language - set - in - database - field . html
def set_language(sender, **kwargs):
    """
    Whenever a user logs in, attempt to set their browser session
    to the right language.
    HT: http://mirobetm.blogspot.com/2012/02/django-language-set-in-database-field.html
    """
    from corehq.apps.users.models import CouchUser
    user = kwargs['user']
    couch_user = CouchUser.from_django_user(user)
    if couch_user and couch_user.language:
        kwargs['request'].session['django_language'] = couch_user.language
def set_language ( sender , * * kwargs ) : from corehq . apps . users . models import CouchUser user = kwargs [ 'user' ] couch_user = CouchUser . from_django_user ( user ) if couch_user and couch_user . language : kwargs [ 'request' ] . session [ 'django_language' ] = couch_user . language