Skip to content

Commit

Permalink
Merge pull request #35027 from jgrocha/backport-34795-to-release-3_12
Browse files Browse the repository at this point in the history
[Backport release-3_12] Fix TypeError when displaying Postgis layers extent
  • Loading branch information
elpaso committed Mar 18, 2020
2 parents 4e732c4 + 5d41785 commit d1dbe73
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions python/plugins/db_manager/db_plugins/info_model.py
Expand Up @@ -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>)')
Expand Down

0 comments on commit d1dbe73

Please sign in to comment.