Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def export_object(request):
if request.method == "POST" and request.is_ajax():
params = dict(request.POST.copy().dict())
type_ = params.get('tlo_type', None)
id_ = params.get('oid', None)
if type_:
del params['tlo_type']
del params['oid']
results = handlers.export_object(request, type_, id_, params)
return HttpResponse(json.dumps(results),
content_type="application/json")
else:
return render_to_response('error.html',
{'error': "Must be AJAX."},
RequestContext(request))