Subject: PATCH: To fix the issue in Rules node (pgAdmin4)

From: Murtuza Zabuawala <[email-masked]>
Date: Tue, 13 Sep 2016 13:31:03 +0530

Hi,

PFA minor patch for rules node where it was throwing when user tries to
create new rule.
RM#1681

--
Regards,
Murtuza Zabuawala
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company
diff --git a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/rules/sql/update.sql b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/rules/sql/update.sql
index 099d6e4..2476823 100644
--- a/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/rules/sql/update.sql
+++ b/web/pgadmin/browser/server_groups/servers/databases/schemas/tables/templates/rules/sql/update.sql
@@ -7,7 +7,7 @@
 {% if data.name and data.name != o_data.name %}
 ALTER RULE {{ conn|qtIdent(o_data.name) }} ON {{ conn|qtIdent(o_data.schema, o_data.view) }} RENAME TO {{ conn|qtIdent(data.name) }};{{ '\r\r' }}
 {% endif %}
-{% if data.event or data.do_instead or data.condition or data.statements %}
+{% if data.event or data.do_instead is defined or data.condition or data.statements %}
 CREATE OR REPLACE RULE {{ conn|qtIdent(rule_name) }} AS
     ON {% if data.event and data.event != o_data.event %}{{ data.event|upper }}{% else %}{{ o_data.event|upper }}{% endif %}
  TO {{ conn|qtIdent(o_data.schema, o_data.view) }}

-- 
Sent via pgadmin-hackers mailing list ([email-masked])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgadmin-hackers

---

From: Dave Page <[email-masked]>
Date: Wed, 14 Sep 2016 10:39:26 +0100

Thanks, applied.

-- 
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake

EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company