@require_POST
def edit_scribble_field(request, ct_pk, instance_pk, field_name):
    if not request.user.is_authenticated():
        return HttpResponseForbidden()
    content_type = get_object_or_404(ContentType, pk=ct_pk)
    perm_name = '{0}.change_{1}'.format(content_type.app_label, content_type.model)
    if not request.user.has_perm(perm_name):
        return HttpResponseForbidden()
    form = FieldScribbleForm(content_type, instance_pk, field_name, data=request.POST)
    results = {
        'valid': False,
    }
    if form.is_valid():
        results['valid'] = True
        form.save()
    else:
        results['error'] = {
            'message': ','.join(e % '%s' for e in form.errors.values()),
            'line': '',
        }
    results['url'] = form.get_save_url()
    content = json.dumps(results, cls=DjangoJSONEncoder, ensure_ascii=False)
    return HttpResponse(content, content_type='application/json')
dataset/ETHPy150Open caktus/django-scribbler/scribbler/views.py/edit_scribble_field/swapped operands of `%`