How to use the threatexchange.handlers.get_dropdowns function in threatexchange

To help you get started, we’ve selected a few threatexchange examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github crits / crits_services / threatexchange / views.py View on Github external
def get_dropdowns(request):
    if request.method == "POST" and request.is_ajax():
        results = handlers.get_dropdowns()
        return HttpResponse(json.dumps(results),
                            content_type="application/json")
    else:
        return render_to_response('error.html',
                                  {'error': "Must be AJAX."},
                                  RequestContext(request))