@permission_required("core.manage_shop")
@require_POST
def sort_shipping_methods(request):
    shipping_methods = request.POST.get("objs", "").split('&')
    assert (isinstance(shipping_methods, list))
    if len(shipping_methods) > 0:
        priority = 10
        for sm_str in shipping_methods:
            sm_id = sm_str.split('=')[1]
            sm_obj = ShippingMethod.objects.get(pk=sm_id)
            sm_obj.priority = priority
            sm_obj.save()
            priority = priority + 10

        result = json.dumps({
            "message": _(u"The shipping methods have been sorted."),
        }, cls=LazyEncoder)

        return HttpResponse(result, content_type='application/json')
Wrapper around `translation.get_language` that returns the normalized
dataset/ETHPy150Open diefenbach/django-lfs/lfs/manage/shipping_methods/views.py/sort_shipping_methods--crossover with--dataset/ETHPy150Open zmathew/django-linguo/linguo/utils.py/get_current_language