Skip to content

Use GeoJsonSerializer when geojson is requested via the format query param#3124

Open
SAY-5 wants to merge 3 commits into
onaio:mainfrom
SAY-5:fix-dataview-geojson-query-param
Open

Use GeoJsonSerializer when geojson is requested via the format query param#3124
SAY-5 wants to merge 3 commits into
onaio:mainfrom
SAY-5:fix-dataview-geojson-query-param

Conversation

@SAY-5

@SAY-5 SAY-5 commented Jun 9, 2026

Copy link
Copy Markdown

Changes / Features implemented

DataViewViewSet.data resolves the export format from the URL kwarg and falls back to the format query param, but get_serializer_class only looked at the kwarg. Requesting geojson via ?format=geojson therefore took the geojson branch in data while get_serializer_class returned JsonDataSerializer, which calls DECRYPTION_ERROR in instance on raw Instance objects and raises TypeError: argument of type 'Instance' is not iterable. This makes get_serializer_class use the same fallback so the GeoJsonSerializer is selected, and adds a regression assertion to the geojson dataview test.

Closes #3114.


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag /codesmith with what you need. Autofix is disabled.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TypeError: argument of type 'Instance' is not iterable

1 participant