Skip to content

Commit be58484

Browse files
committed
fix(tools_qgis): ignore querylayers
1 parent f58adad commit be58484

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tools_qgis.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1554,8 +1554,10 @@ def check_query_layer(layer):
15541554
try:
15551555
# TODO:: Find differences between PostgreSQL and query layers, and replace this if condition.
15561556
table_uri = layer.dataProvider().dataSourceUri()
1557-
if 'SELECT row_number() over ()' in str(table_uri) or \
1558-
layer is None or type(layer) is not QgsVectorLayer:
1557+
if layer is None \
1558+
or getattr(layer, 'isSqlQuery', False) \
1559+
or 'SELECT row_number() over ()' in str(table_uri) \
1560+
or type(layer) is not QgsVectorLayer:
15591561
return False
15601562
return True
15611563
except Exception:

0 commit comments

Comments
 (0)