Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions src/django/api/extended_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,19 @@ def get_facility_and_processing_type_extendfield_value(
is_claim_edit=False
):
if is_claim_edit:
field_value_capitalized = (
[value.capitalize() for value in field_value]
)
field_value_capitalized = []

if isinstance(field_value, list):
field_value_capitalized = (
[value.capitalize() for value in field_value]
)

if isinstance(field_value, str):
field_values_separated = field_value.split("|")
field_value_capitalized = (
[value.strip().capitalize() for value in field_values_separated]
)

raw_values = '|'.join(field_value_capitalized)
results = get_matched_values(field_value_capitalized, sector)
else:
Expand Down
18 changes: 1 addition & 17 deletions src/django/api/views/facility/facilities_view_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,30 +966,14 @@ def claim(self, request, pk=None):
facility_production_types=validated_data.get(
"facility_production_types", []
),
facility_type=validated_data.get("facility_type"),
)

sectors = validated_data.get("sectors")

if sectors and len(sectors) > 0:
facility_claim.sector = sectors

facility_type = validated_data.get("facility_type")

if facility_type:
(_, __, facility_type_value, processing_type_value) = (
get_facility_and_processing_type(
facility_type, sectors,
)
)

if facility_type_value:
facility_claim.facility_type = facility_type_value

if processing_type_value:
facility_claim.facility_production_types.append(
processing_type_value,
)

facility_claim.save()

for file in files:
Expand Down
2 changes: 1 addition & 1 deletion src/react/src/util/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -1329,7 +1329,7 @@ export const appendFacilityType = (postData, formattedKey, value) => {
}

const extractedValues = value.map(extractSelectValue);
postData.append(formattedKey, extractedValues.join(', '));
postData.append(formattedKey, extractedValues.join('|'));
};

/**
Expand Down
Loading