def move_language_preference(apps, schema_editor):
    """Move language from parameters to User model."""
    UserParameter = apps.get_model('lib', 'UserParameter')
    for uparam in UserParameter.objects.filter(name='core.LANG'):
        uparam.user.language = uparam.value
        uparam.user.save()
        uparam.delete()
