From db24654f65621b02eb858b43fbe2151f9ef7876e Mon Sep 17 00:00:00 2001 From: antonio Date: Fri, 19 Apr 2019 16:33:34 +0200 Subject: [PATCH] Bugfixing: Always allow all operations when an empty recordset is passed --- web_access_rule_buttons/models/models.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web_access_rule_buttons/models/models.py b/web_access_rule_buttons/models/models.py index 1d50743c1..629778e7a 100644 --- a/web_access_rule_buttons/models/models.py +++ b/web_access_rule_buttons/models/models.py @@ -22,7 +22,7 @@ class Base(models.AbstractModel): operations = ['read', 'create', 'write', 'unlink'] result = {} for operation in operations: - if self.is_transient() and not self.ids: + if self.is_transient() or not self.ids: # If we call check_access_rule() without id, it will try to # run a SELECT without ID which will crash, so we just blindly # allow the operations