diff --git a/rest_framework_mvt/managers.py b/rest_framework_mvt/managers.py index 654b817..a7ad065 100644 --- a/rest_framework_mvt/managers.py +++ b/rest_framework_mvt/managers.py @@ -12,7 +12,7 @@ class MVTManager(models.Manager): """ def __init__(self, *args, geo_col="geom", source_name=None, **kwargs): - super(MVTManager, self).__init__(*args, **kwargs) + super().__init__(*args, **kwargs) self.geo_col = geo_col self.source_name = source_name @@ -105,7 +105,7 @@ def _create_where_clause_with_params(self, table, filters): try: sql, params = self.filter(**filters).query.sql_with_params() except FieldError as error: - raise ValidationError(str(error)) + raise ValidationError(str(error)) from error extra_wheres = " AND " + sql.split("WHERE")[1].strip() if params else "" where_clause = ( f"ST_Intersects({table}.{self.geo_col}, " diff --git a/rest_framework_mvt/views.py b/rest_framework_mvt/views.py index 7876a9e..fe8eb8e 100644 --- a/rest_framework_mvt/views.py +++ b/rest_framework_mvt/views.py @@ -70,7 +70,7 @@ def _validate_paginate(limit, offset): except ValueError as value_error: raise ValidationError( "Query param validation error: " + str(value_error) - ) + ) from value_error return limit, offset