Skip to content

Commit

Permalink
corteva#10 Fix use of in operator in filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiendarocha committed Nov 6, 2021
1 parent 33ec44b commit f974b09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion rest_framework_mvt/managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ def _create_where_clause_with_params(self, table, filters):
sql, params = self.filter(**filters).query.sql_with_params()
except FieldError as error:
raise ValidationError(str(error)) from error
extra_wheres = " AND " + sql.split("WHERE")[1].strip() if params else ""
extra_wheres = " AND " + sql.split("WHERE",1)[1].strip() if params else ""
where_clause = (
f"ST_Intersects(ST_Transform({table}.{self.geo_col}, 4326), "
f"ST_SetSRID(ST_GeomFromText(%s), 4326)){extra_wheres}"
Expand Down

0 comments on commit f974b09

Please sign in to comment.