Fix SQL tab issue for Views. It's a regression of compound triggers. Fixes #4650

This commit is contained in:
Akshay Joshi 2019-08-23 10:22:20 +05:30
parent 6192c48ef9
commit 232fe286ee
2 changed files with 4 additions and 3 deletions

View File

@ -23,3 +23,4 @@ Bug fixes
| `Issue #2828 <https://redmine.postgresql.org/issues/2828>`_ - Added Gather Merge, Named Tuple Store Scan and Table Function Scan icon for explain module. | `Issue #2828 <https://redmine.postgresql.org/issues/2828>`_ - Added Gather Merge, Named Tuple Store Scan and Table Function Scan icon for explain module.
| `Issue #4643 <https://redmine.postgresql.org/issues/4643>`_ - Fix Truncate option deselect issue for compound triggers. | `Issue #4643 <https://redmine.postgresql.org/issues/4643>`_ - Fix Truncate option deselect issue for compound triggers.
| `Issue #4644 <https://redmine.postgresql.org/issues/4644>`_ - Fix length and precision enable/disable issue when changing the data type for Domain node. | `Issue #4644 <https://redmine.postgresql.org/issues/4644>`_ - Fix length and precision enable/disable issue when changing the data type for Domain node.
| `Issue #4650 <https://redmine.postgresql.org/issues/4650>`_ - Fix SQL tab issue for Views. It's a regression of compound triggers.

View File

@ -879,6 +879,7 @@ class ViewNode(PGChildNodeView, VacuumSettings):
Get all compound trigger nodes associated with view node, Get all compound trigger nodes associated with view node,
generate their sql and render into sql tab generate their sql and render into sql tab
""" """
SQL_data = ''
if self.manager.server_type == 'ppas' \ if self.manager.server_type == 'ppas' \
and self.manager.version >= 120000: and self.manager.version >= 120000:
@ -888,7 +889,6 @@ class ViewNode(PGChildNodeView, VacuumSettings):
# Define template path # Define template path
self.ct_trigger_temp_path = 'compound_triggers' self.ct_trigger_temp_path = 'compound_triggers'
SQL_data = ''
SQL = render_template("/".join( SQL = render_template("/".join(
[self.ct_trigger_temp_path, [self.ct_trigger_temp_path,
'sql/{0}/#{1}#/nodes.sql'.format( 'sql/{0}/#{1}#/nodes.sql'.format(