Skip to content
Permalink
Browse files

Simplify other_fields checker

  • Loading branch information
dericke authored and nyalldawson committed Feb 20, 2021
1 parent 6d5bf2b commit f3a60ebfe7e82b370730b8cb02026d0c71ce73c1
Showing with 5 additions and 3 deletions.
  1. +5 −3 python/plugins/processing/algs/gdal/OneSideBuffer.py
@@ -133,10 +133,12 @@ def getConsoleCommands(self, parameters, context, feedback, executing=True):
'-sql'
]

other_fields = ',*' if any(
f for f in fields
other_fields_exist = any(
True for f in fields
if f.name() != geometry
) else ''
)

other_fields = ',*' if other_fields_exist else ''

if dissolve or fieldName:
sql = 'SELECT ST_Union(ST_SingleSidedBuffer({}, {}, {})) AS {}{} FROM "{}"'.format(geometry, distance, side, geometry, other_fields, layerName)

0 comments on commit f3a60eb

Please sign in to comment.