From ed905e4177999afb19ea0297fdf7cfdb3b516bb1 Mon Sep 17 00:00:00 2001 From: Gabriel Detraz Date: Mon, 8 Jan 2018 12:35:19 +0100 Subject: [PATCH] Fix changement de mdp --- re2o/templatetags/acl.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/re2o/templatetags/acl.py b/re2o/templatetags/acl.py index 79bdbc5f..810a6378 100644 --- a/re2o/templatetags/acl.py +++ b/re2o/templatetags/acl.py @@ -385,7 +385,10 @@ class AclNode(Node): def render(self, context): resolved_args = [arg.resolve(context) for arg in self.args] - can, _ = self.callback(context['user'], *(resolved_args)) + if context['user'].is_anonymous(): + can = False + else: + can, _ = self.callback(context['user'], *(resolved_args)) if can: return self.oknodes.render(context) return self.konodes.render(context) @@ -404,7 +407,10 @@ class AclInstanceNode(Node): def render(self, context): callback = get_callback(self.tag_name, self.instance.resolve(context)) resolved_args = [arg.resolve(context) for arg in self.args] - can, _ = callback(context['user'], *(resolved_args)) + if context['user'].is_anonymous(): + can = False + else: + can, _ = callback(context['user'], *(resolved_args)) if can: return self.oknodes.render(context) return self.konodes.render(context)