Skip to content

Commit 011d489

Browse files
susilnemtnagorra
authored andcommitted
fixup! feat(asset): Add validation checks for geojson data
1 parent 591dd9d commit 011d489

File tree

1 file changed

+1
-11
lines changed

1 file changed

+1
-11
lines changed

utils/common.py

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -136,17 +136,7 @@ def validate_geojson_file(file: ContentFile) -> None:
136136
except json.JSONDecodeError as e:
137137
raise ValidationError("Invalid JSON format in the file.") from e
138138

139-
try:
140-
feature_collection = FeatureCollection(**geojson_data)
141-
except ValidationError as e:
142-
raise ValidationError(
143-
"Invalid GeoJSON format. Ensure it is a valid FeatureCollection.",
144-
) from e
145-
146-
if feature_collection.type != "FeatureCollection":
147-
raise ValidationError(
148-
"GeoJSON must be a FeatureCollection.",
149-
)
139+
feature_collection = FeatureCollection(**geojson_data)
150140

151141
if not feature_collection.features:
152142
raise ValidationError("GeoJSON 'features' list cannot be empty.")

0 commit comments

Comments
 (0)