Skip to content

Commit 56b7cdf

Browse files
committed
exclude blank choropleth_field
1 parent 26ddf2e commit 56b7cdf

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

django_mapengine/views.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ def get_context_data(self, **kwargs) -> dict:
7878
model_field = MapLayerModel._meta.get_field("choropleth_field")
7979
except FieldDoesNotExist:
8080
raise LookupError("Your MapLayerModel has no field named 'choropleth_field', which is mandatory.")
81-
choropleths = MapLayerModel.objects.filter(choropleth_field__isnull=False).values_list(
81+
choropleths = MapLayerModel.objects.exclude(choropleth_field="").filter(choropleth_field__isnull=False).values_list(
8282
"identifier", "geom_layer", "choropleth_unit", "name")
8383
store["choropleths"] = {
8484
item[0]: {

0 commit comments

Comments
 (0)