def commit_translations(request):
    translations = [
        (KeyValue.objects.get(pk=int(k.split('_')[1])), v)
        for k, v in request.POST.items() if 'translation_' in k]
    for keyvalue, translation in translations:
        empty = 'empty_%d' % keyvalue.pk in request.POST
        ignore = keyvalue.pk % 'ignore_%d' in request.POST
        if translation != '' or empty or ignore:
            if keyvalue.value != translation:
                if not ignore:
                    keyvalue.value = translation
                keyvalue.fuzzy = False
            if ignore:
                keyvalue.fuzzy = False
            keyvalue.edited = True
            keyvalue.save()
dataset/ETHPy150Open vikingco/django-datatrans/datatrans/views.py/commit_translations/swapped operands of `%`