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_privacy_group_form(request):
if request.method == "POST" and request.is_ajax():
initial = request.POST.copy()
form = forms.ThreatExchangePrivacyGroupForm(initial=initial)
template = render_to_string("privacy_form.html",
{'privacy_group_form': form})
result = {'success': True,
'html': template}
return HttpResponse(json.dumps(result),
content_type="application/json")
else:
return render_to_response('error.html',
{'error': "Must be AJAX."},
RequestContext(request))
def __init__(self, *args, **kwargs):
kwargs.setdefault('label_suffix', ':')
super(ThreatExchangePrivacyGroupForm, self).__init__(*args, **kwargs)