merged crown jewels
This commit is contained in:
@@ -9,14 +9,12 @@ class OrganizationForm(forms.ModelForm):
|
||||
'compliance_frameworks', 'industry_sector', 'it_dependency', 'data_sensitivity',
|
||||
'network_infrastructure', 'remote_workforce_percentage', 'third_party_vendor_access',
|
||||
'internal_software_development', 'geographic_scope', 'customer_base', 'customer_type',
|
||||
'product_portfolio', 'supplier_base', 'it_infrastructure', 'intellectual_property',
|
||||
'sensitive_data','sensitive_data_types', 'integration_level', 'ip_value', 'change_rate', 'threat_actors', 'expert_analysis'
|
||||
'product_portfolio', 'supplier_base', 'it_infrastructure',
|
||||
'sensitive_data_types', 'integration_level', 'change_rate', 'threat_actors', 'expert_analysis'
|
||||
]
|
||||
widgets = {
|
||||
'compliance_frameworks': forms.CheckboxSelectMultiple(),
|
||||
'it_infrastructure': forms.CheckboxSelectMultiple(),
|
||||
'intellectual_property': forms.CheckboxSelectMultiple(),
|
||||
'sensitive_data': forms.CheckboxSelectMultiple(),
|
||||
'threat_actors': forms.CheckboxSelectMultiple(),
|
||||
'sensitive_data_types': forms.CheckboxSelectMultiple(),
|
||||
}
|
||||
@@ -38,13 +36,24 @@ class OrganizationForm(forms.ModelForm):
|
||||
if sector == 'other' and sector_other:
|
||||
cleaned_data['industry_sector'] = sector_other
|
||||
|
||||
# Handle sensitive_data_types
|
||||
types = cleaned_data.get('sensitive_data_types') or []
|
||||
other_type = self.data.get('sensitive_data_types_other', '').strip()
|
||||
if 'other' in types and other_type:
|
||||
types = [t for t in types if t != 'other']
|
||||
types.append(other_type)
|
||||
cleaned_data['sensitive_data_types'] = types
|
||||
# Handle Sensitive Data Types & Business Impact
|
||||
sensitive_data_types = {}
|
||||
data_types = [
|
||||
('personal', 'personal_applicable', 'personal_impact'),
|
||||
('financial', 'financial_applicable', 'financial_impact'),
|
||||
('ip', 'ip_applicable', 'ip_impact'),
|
||||
('operational', 'operational_applicable', 'operational_impact'),
|
||||
('government', 'government_applicable', 'government_impact'),
|
||||
('none', 'none_applicable', None)
|
||||
]
|
||||
for key, applicable_name, impact_name in data_types:
|
||||
applicable = self.data.get(applicable_name) == 'on'
|
||||
entry = {'applicable': applicable}
|
||||
if impact_name:
|
||||
impact = self.data.get(impact_name)
|
||||
entry['impact'] = int(impact) if impact and impact.isdigit() else None
|
||||
sensitive_data_types[key] = entry
|
||||
cleaned_data['sensitive_data_types'] = sensitive_data_types
|
||||
|
||||
return cleaned_data
|
||||
|
||||
|
||||
Reference in New Issue
Block a user