Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def __init__(self, *args, **kwargs):
kwargs.setdefault('label_suffix', ':')
super(ThreatExchangeConfigForm, self).__init__(*args, **kwargs)
def generate_config_form(self, config):
html = render_to_string('services_config_form.html',
{'name': self.name,
'form': forms.ThreatExchangeConfigForm(
initial=config),
'config_error': None})
form = forms.ThreatExchangeConfigForm
return form, html
def get_config_details(config):
display_config = {}
# Rename keys so they render nice.
fields = forms.ThreatExchangeConfigForm().fields
for name, field in fields.iteritems():
display_config[field.label] = config[name]
return display_config