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