Skip to content
Permalink
Browse files

Merge pull request #35027 from jgrocha/backport-34795-to-release-3_12

[Backport release-3_12] Fix TypeError when displaying Postgis layers extent
  • Loading branch information
elpaso committed Mar 18, 2020
2 parents 4e732c4 + 5d41785 commit d1dbe733e2d7ded9e8e43b2a0605789a19df80e9
Showing with 8 additions and 2 deletions.
  1. +8 −2 python/plugins/db_manager/db_plugins/info_model.py
@@ -397,12 +397,18 @@ def spatialInfo(self):
self.table.blockSignals(False)

if self.table.estimatedExtent is not None and self.table.estimatedExtent[0] is not None:
estimated_extent_str = '%.5f, %.5f - %.5f, %.5f' % self.table.estimatedExtent
if isinstance(self.table.estimatedExtent, list):
estimated_extent_str = ', '.join('%.5f' % e for e in self.table.estimatedExtent)
else:
estimated_extent_str = '%.5f, %.5f - %.5f, %.5f' % self.table.estimatedExtent
tbl.append((QApplication.translate("DBManagerPlugin", "Estimated extent:"), estimated_extent_str))

# extent
if self.table.extent is not None and self.table.extent[0] is not None:
extent_str = '%.5f, %.5f - %.5f, %.5f' % self.table.extent
if isinstance(self.table.extent, list):
extent_str = ', '.join('%.5f' % e for e in self.table.extent)
else:
extent_str = '%.5f, %.5f - %.5f, %.5f' % self.table.extent
else:
extent_str = QApplication.translate("DBManagerPlugin",
'(unknown) (<a href="action:extent/get">find out</a>)')

0 comments on commit d1dbe73

Please sign in to comment.
You can’t perform that action at this time.