Skip to content

Commit

Permalink
Simplify other_fields checker
Browse files Browse the repository at this point in the history
  • Loading branch information
dericke authored and nyalldawson committed Feb 20, 2021
1 parent 6d5bf2b commit f3a60eb
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions python/plugins/processing/algs/gdal/OneSideBuffer.py
Expand Up @@ -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)
Expand Down

0 comments on commit f3a60eb

Please sign in to comment.